Added cuisine translation to context menu

This commit is contained in:
Alexey Kulish 2016-10-16 15:15:38 +03:00
parent f6c89282ff
commit f8eb5fc07e
2 changed files with 14 additions and 1 deletions

View file

@ -25,6 +25,7 @@ public class Amenity extends MapObject {
public static final String DESCRIPTION = "description";
public static final String OPENING_HOURS = "opening_hours";
public static final String CONTENT = "content";
public static final String CUISINE = "cuisine";
private String subType;
private PoiCategory type;

View file

@ -269,6 +269,18 @@ public class AmenityMenuBuilder extends MenuBuilder {
} else if (Amenity.WEBSITE.equals(key)) {
iconId = R.drawable.ic_world_globe_dark;
isUrl = true;
} else if (Amenity.CUISINE.equals(key)) {
iconId = R.drawable.ic_action_cuisine;
StringBuilder sb = new StringBuilder();
for (String c : e.getValue().split(";")) {
if (sb.length() > 0) {
sb.append(", ");
} else {
sb.append(app.getString(R.string.poi_cuisine)).append(": ");
}
sb.append(poiTypes.getPoiTranslation("cuisine_" + c).toLowerCase());
}
vl = sb.toString();
} else {
if (key.contains(Amenity.DESCRIPTION)) {
iconId = R.drawable.ic_action_note_dark;
@ -283,7 +295,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
}
if (!pType.isText()) {
if (!Algorithms.isEmpty(pType.getPoiAdditionalCategory())) {
vl = pType.getPoiAdditionalCategoryTranslation() + ": " + pType.getTranslation();
vl = pType.getPoiAdditionalCategoryTranslation() + ": " + pType.getTranslation().toLowerCase();
} else {
vl = pType.getTranslation();
}