Merge pull request #5153 from osmandapp/RefIsPartOfTheName

Ref is part of the name in context menu
This commit is contained in:
Alexander Sytnyk 2018-03-22 14:18:56 +02:00 committed by GitHub
commit 1f076d769a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,7 @@
package net.osmand.plus.mapcontextmenu.controllers;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import net.osmand.data.Amenity;
import net.osmand.data.LatLon;
@ -136,9 +137,17 @@ public class AmenityMenuController extends MenuController {
@Override
public String getNameStr() {
return amenity.getName(
String name = amenity.getName(
amenity.getType().isWiki() ? getPreferredMapAppLang() : getPreferredMapLang(),
isTransliterateNames());
Map<String, String> additionalInfo = amenity.getAdditionalInfo();
if (additionalInfo != null) {
String ref = additionalInfo.get("ref");
if (!TextUtils.isEmpty(ref)) {
return name + " (" + ref + ")";
}
}
return name;
}
@Override