fix method names

This commit is contained in:
sonora 2016-11-20 14:14:06 +01:00
parent dae40d8354
commit 5eaea4046c
5 changed files with 8 additions and 8 deletions

View file

@ -171,7 +171,7 @@ public class Amenity extends MapObject {
setAdditionalInfo(PHONE, phone);
}
public String getContentSelected(String tag, String lang, String defLang) {
public String getContentLanguage(String tag, String lang, String defLang) {
if (lang != null) {
String translateName = getAdditionalInfo(tag + ":" + lang);
if (!Algorithms.isEmpty(translateName)) {
@ -213,7 +213,7 @@ public class Amenity extends MapObject {
return l;
}
public String getContentLang(String tag, String lang) {
public String getTagContent(String tag, String lang) {
if (lang != null) {
String translateName = getAdditionalInfo(tag + ":" + lang);
if (!Algorithms.isEmpty(translateName)) {
@ -237,11 +237,11 @@ public class Amenity extends MapObject {
}
public String getDescription(String lang) {
String info = getContentLang(DESCRIPTION, lang);
String info = getTagContent(DESCRIPTION, lang);
if (!Algorithms.isEmpty(info)) {
return info;
}
return getContentLang(CONTENT, lang);
return getTagContent(CONTENT, lang);
}
public void setDescription(String description) {

View file

@ -367,7 +367,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
if (amenity.getType().isWiki()) {
if (!hasWiki) {
iconId = R.drawable.ic_action_note_dark;
String lng = amenity.getContentSelected("content", preferredLang, "en");
String lng = amenity.getContentLanguage("content", preferredLang, "en");
if (Algorithms.isEmpty(lng)) {
lng = "en";
}

View file

@ -331,7 +331,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
topBar.setBackgroundColor(ContextCompat.getColor(ctx, getResIdFromAttribute(ctx, R.attr.pstsTabBackground)));
topBar.setTitleTextColor(ContextCompat.getColor(ctx, getResIdFromAttribute(ctx, R.attr.pstsTextColor)));
String lng = a.getContentSelected("content", preferredLang, "en");
String lng = a.getContentLanguage("content", preferredLang, "en");
if (Algorithms.isEmpty(lng)) {
lng = "en";
}

View file

@ -67,7 +67,7 @@ public class ContextMenuHelper {
topBar.setBackgroundColor(ContextCompat.getColor(ctx, R.color.osmand_orange));
topBar.setTitleTextColor(ContextCompat.getColor(ctx, R.color.color_white));
String lng = a.getContentSelected("content", preferredLang, "en");
String lng = a.getContentLanguage("content", preferredLang, "en");
if (Algorithms.isEmpty(lng)) {
lng = "en";
}

View file

@ -363,7 +363,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
if (amenity.getType().isWiki()) {
if (!hasWiki) {
iconId = OsmandResources.getDrawableId("ic_action_note_dark");
String lng = amenity.getContentSelected("content", preferredLang, "en");
String lng = amenity.getContentLanguage("content", preferredLang, "en");
if (Algorithms.isEmpty(lng)) {
lng = "en";
}