Merge pull request #5153 from osmandapp/RefIsPartOfTheName
Ref is part of the name in context menu
This commit is contained in:
commit
1f076d769a
1 changed files with 10 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
package net.osmand.plus.mapcontextmenu.controllers;
|
package net.osmand.plus.mapcontextmenu.controllers;
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import net.osmand.data.Amenity;
|
import net.osmand.data.Amenity;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
|
@ -136,9 +137,17 @@ public class AmenityMenuController extends MenuController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getNameStr() {
|
public String getNameStr() {
|
||||||
return amenity.getName(
|
String name = amenity.getName(
|
||||||
amenity.getType().isWiki() ? getPreferredMapAppLang() : getPreferredMapLang(),
|
amenity.getType().isWiki() ? getPreferredMapAppLang() : getPreferredMapLang(),
|
||||||
isTransliterateNames());
|
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
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue