From 2e55393c4f1728ddefd23e4502e0cf613389fdc2 Mon Sep 17 00:00:00 2001 From: Chumva Date: Fri, 4 May 2018 11:26:07 +0300 Subject: [PATCH] added sort languages for wikivoyage popupMenu --- .../wikivoyage/article/WikivoyageArticleDialogFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java index 98cd31fe51..cf2411006e 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java @@ -253,7 +253,8 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme for (String n : langs) { names.put(n, FileNameTranslationHelper.getVoiceName(getContext(), n)); } - for (final Map.Entry e : names.entrySet()) { + Map sortedNames = AndroidUtils.sortByValue(names); + for (final Map.Entry e : sortedNames.entrySet()) { final String lang = e.getValue(); final String langKey = e.getKey(); MenuItem item = popup.getMenu().add(lang);