Skip to content

Code Enhancement (Explore Map) #6293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 21, 2025
Merged

Conversation

khushbuk0711
Copy link
Contributor

Description (required)

Fixes #6266

What changes did you make and why?

  • Code enhancement
  • Map showed information wider than screen size

Tests performed (required)

Tested {build variant, e.g. ProdDebug} on {name of device or emulator} with API level {API level}.
Tested {build variant :-betaDebug} on {OnePlus Nord CE4 Lite} with API level {35}.
Screenshots (for UI changes only)

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@@ -717,8 +717,17 @@ private void addMarkerToMap(BaseMarker nearbyBaseMarker) {
authorUser = Html.fromHtml(authorUser, Html.FROM_HTML_MODE_LEGACY).toString();
}

OverlayItem item = new OverlayItem(nearbyBaseMarker.getPlace().name,
authorUser, point);
String title = nearbyBaseMarker.getPlace().name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does getPlace() have something like .caption or .label? That would be better, though that can be split to a different issue.

Copy link
Contributor Author

@khushbuk0711 khushbuk0711 Apr 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getLabel() is causing some issue and there is nothing like .caption

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What issue exactly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The app is getting crashed

}
title = title.replaceAll("(?i)\\.(jpg|jpeg|png|svg)$", "");
title = title.replace("_", " ");
if (title.length() >43) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding a comment explaining why truncating is necessary? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are truncating because the title doesn't fits in the box

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please add this info as a code comment // so that future readers will know why. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope this works

khushbuk0711 and others added 2 commits April 21, 2025 07:11

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link

✅ Generated APK variants!

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good improvement, thanks! 🙂

Screenshot_20250421-144521.png

@nicolas-raoul nicolas-raoul merged commit 7479d96 into commons-app:main Apr 21, 2025
1 check passed
sonalyadav1 pushed a commit to sonalyadav1/apps-android-commons that referenced this pull request May 22, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Map shows information wider than screen size
2 participants