mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Code Enhancement (Explore Map) (#6293)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* Exclude past locations (P585) from Nearby query * "Send" button text should be white * Custom picker: logic * Revert back changes * Enhancement :- Explore Map information * Enhancement :- Explore Map information * Style --------- Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
This commit is contained in:
parent
ed42d85f67
commit
7479d96675
2 changed files with 18 additions and 6 deletions
|
|
@ -717,8 +717,20 @@ public class ExploreMapFragment extends CommonsDaggerSupportFragment
|
|||
authorUser = Html.fromHtml(authorUser, Html.FROM_HTML_MODE_LEGACY).toString();
|
||||
}
|
||||
|
||||
OverlayItem item = new OverlayItem(nearbyBaseMarker.getPlace().name,
|
||||
authorUser, point);
|
||||
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) + "…";
|
||||
}
|
||||
|
||||
OverlayItem item = new OverlayItem(title, authorUser, point);
|
||||
item.setMarker(d);
|
||||
items.add(item);
|
||||
ItemizedOverlayWithFocus overlay = new ItemizedOverlayWithFocus(items,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue