Merge pull request #5342 from osmandapp/WikipediaImprovements

added sort languages for wikivoyage popupMenu
This commit is contained in:
Alexey 2018-05-04 11:55:42 +03:00 committed by GitHub
commit 5d91fb2ed0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -253,7 +253,8 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme
for (String n : langs) {
names.put(n, FileNameTranslationHelper.getVoiceName(getContext(), n));
}
for (final Map.Entry<String, String> e : names.entrySet()) {
Map<String, String> sortedNames = AndroidUtils.sortByValue(names);
for (final Map.Entry<String, String> e : sortedNames.entrySet()) {
final String lang = e.getValue();
final String langKey = e.getKey();
MenuItem item = popup.getMenu().add(lang);