From 1b67b8643b8237c9d7e20a55723fad44ad8018b8 Mon Sep 17 00:00:00 2001 From: Khushbu Date: Mon, 21 Apr 2025 07:11:32 +0530 Subject: [PATCH] Enhancement :- Explore Map information --- .../fr/free/nrw/commons/explore/map/ExploreMapFragment.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/fr/free/nrw/commons/explore/map/ExploreMapFragment.java b/app/src/main/java/fr/free/nrw/commons/explore/map/ExploreMapFragment.java index af3990235..0f1f36884 100644 --- a/app/src/main/java/fr/free/nrw/commons/explore/map/ExploreMapFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/explore/map/ExploreMapFragment.java @@ -718,11 +718,14 @@ public class ExploreMapFragment extends CommonsDaggerSupportFragment } String title = nearbyBaseMarker.getPlace().name; + // Remove "File:" if present at start if (title.startsWith("File:")) { title = title.substring(5); } + // Remove extensions like .jpg, .jpeg, .png, .svg (case insensitive) title = title.replaceAll("(?i)\\.(jpg|jpeg|png|svg)$", ""); title = title.replace("_", " "); + //Truncate if too long because it doesn't fit the screen if (title.length() >43) { title = title.substring(0, 40) + "..."; }