Use "ic_action_street_name" for "Copy address";

Show POI Name in line (and distance) - wikipedia as well;
Don't show for public transport.
This commit is contained in:
Skalii 2021-01-12 02:36:46 +02:00
parent 4eb868ef9e
commit 5c2e8fe866
4 changed files with 10 additions and 5 deletions

View file

@ -357,9 +357,10 @@ public class MenuBuilder {
}
protected void buildNearestPoiRow(View view) {
buildNearestRow(view, nearestPoi, processNearestPoi(),
nearestPoi.isEmpty() ? 0 : AmenityMenuController.getRightIconId(nearestPoi.get(0)),
app.getString(R.string.speak_poi));
if (amenity != null) {
buildNearestRow(view, nearestPoi, processNearestPoi(), AmenityMenuController.getRightIconId(amenity),
app.getString(R.string.speak_poi) + " \"" + AmenityMenuController.getTypeStr(amenity) + "\" (" + nearestPoi.size() + ")");
}
}
protected void buildNearestRow(View view, List<Amenity> nearestAmenities, boolean process, int iconId, String text) {
@ -1164,6 +1165,8 @@ public class MenuBuilder {
if (Algorithms.isBlank(name)) {
name = AmenityMenuController.getTypeStr(poi);
}
float dist = (float) MapUtils.getDistance(latLon, poi.getLocation());
name += " (" + OsmAndFormatter.getFormattedDistance(dist, app) + ")";
button.setText(name);
button.setOnClickListener(new View.OnClickListener() {

View file

@ -678,7 +678,8 @@ public class AmenityMenuBuilder extends MenuBuilder {
if (processNearestPoi() && nearestPoi.size() > 0) {
AmenityInfoRow poiInfo = new AmenityInfoRow(
"nearest_poi", AmenityMenuController.getRightIconId(amenity), null, app.getString(R.string.speak_poi) + " (" + nearestPoi.size() + ")", true,
"nearest_poi", AmenityMenuController.getRightIconId(amenity), null,
app.getString(R.string.speak_poi) + " \"" + AmenityMenuController.getTypeStr(amenity) + "\" (" + nearestPoi.size() + ")", true,
getCollapsableView(view.getContext(), true, nearestPoi),
0, false, false, false, 1000, null, false, false, false, 0);
buildAmenityRow(view, poiInfo);

View file

@ -23,6 +23,7 @@ public class TransportStopMenuBuilder extends MenuBuilder {
AmenityMenuBuilder builder = new AmenityMenuBuilder(mapActivity, amenity);
builder.setLatLon(getLatLon());
builder.setLight(light);
builder.setShowNearestPoi(false);
builder.buildInternal(view);
}
}

View file

@ -36,7 +36,7 @@ public class ShareMenu extends BaseMenuController {
public enum ShareItem {
MESSAGE(R.drawable.ic_action_message, R.string.shared_string_send),
CLIPBOARD(R.drawable.ic_action_copy, R.string.shared_string_copy),
ADDRESS(R.drawable.ic_action_copy, R.string.copy_address),
ADDRESS(R.drawable.ic_action_street_name, R.string.copy_address),
NAME(R.drawable.ic_action_copy, R.string.copy_location_name),
COORDINATES(R.drawable.ic_action_copy, R.string.copy_coordinates),
GEO(R.drawable.ic_world_globe_dark, R.string.share_geo),