diff --git a/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java b/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java index 861a7c9b93..32fb9873e2 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/Amenity.java @@ -279,6 +279,19 @@ public class Amenity extends MapObject { } public String getTagContent(String tag, String lang) { + String translateName = getStrictTagContent(tag, lang); + if (translateName != null) { + return translateName; + } + for (String nm : getAdditionalInfoKeys()) { + if (nm.startsWith(tag + ":")) { + return getAdditionalInfo(nm); + } + } + return null; + } + + public String getStrictTagContent(String tag, String lang) { if (lang != null) { String translateName = getAdditionalInfo(tag + ":" + lang); if (!Algorithms.isEmpty(translateName)) { @@ -293,11 +306,6 @@ public class Amenity extends MapObject { if (!Algorithms.isEmpty(enName)) { return enName; } - for (String nm : getAdditionalInfoKeys()) { - if (nm.startsWith(tag + ":")) { - return getAdditionalInfo(nm); - } - } return null; } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageShowPicturesDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageShowPicturesDialogFragment.java index 824a2e9e49..286726e0ac 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageShowPicturesDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/WikivoyageShowPicturesDialogFragment.java @@ -33,50 +33,35 @@ public class WikivoyageShowPicturesDialogFragment extends BottomSheetDialogFragm @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - nightMode=!getMyApplication().getSettings().isLightContent(); + nightMode = !getMyApplication().getSettings().isLightContent(); View view = inflater.inflate(R.layout.fragment_wikivoyage_show_images_first_time, container, false); - view.findViewById(R.id.button_no).setOnClickListener(new View.OnClickListener() { + TextView buttonNo = view.findViewById(R.id.button_no); + buttonNo.setText(R.string.shared_string_only_with_wifi); + buttonNo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { OsmandApplication app = getMyApplication(); if (app != null) { - app.getSettings().WIKI_ARTICLE_SHOW_IMAGES.set(WikiArticleShowImages.OFF); + app.getSettings().WIKI_ARTICLE_SHOW_IMAGES.set(WikiArticleShowImages.WIFI); } sendResult(); dismiss(); } }); TextView buttonDownload = view.findViewById(R.id.button_download); - if (getMyApplication().getSettings().isWifiConnected()) { - buttonDownload.setText(R.string.shared_string_only_with_wifi); - buttonDownload.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - OsmandApplication app = getMyApplication(); - if (app != null) { - app.getSettings().WIKI_ARTICLE_SHOW_IMAGES.set(WikiArticleShowImages.WIFI); - } - sendResult(); - dismiss(); + buttonDownload.setText(R.string.shared_string_always); + buttonDownload.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + OsmandApplication app = getMyApplication(); + if (app != null) { + app.getSettings().WIKI_ARTICLE_SHOW_IMAGES.set(WikiArticleShowImages.ON); } - }); - } else { - buttonDownload.setText(R.string.shared_string_show); - buttonDownload.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - OsmandApplication app = getMyApplication(); - if (app != null) { - app.getSettings().WIKI_ARTICLE_SHOW_IMAGES.set(WikiArticleShowImages.ON); - } - sendResult(); - dismiss(); - } - }); - } - + sendResult(); + dismiss(); + } + }); setupHeightAndBackground(view); - return view; } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 56a2b85269..cdd90e21bd 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -280,7 +280,7 @@ public class TravelObfHelper implements TravelHelper { res.originalId = 0; res.lang = lang; res.contentsJson = Algorithms.emptyIfNull(amenity.getTagContent(Amenity.CONTENT_JSON, lang)); - res.aggregatedPartOf = Algorithms.emptyIfNull(amenity.getTagContent(Amenity.IS_AGGR_PART, lang)); + res.aggregatedPartOf = Algorithms.emptyIfNull(amenity.getStrictTagContent(Amenity.IS_AGGR_PART, lang)); return res; }