From 4ac7e0c9677627968c6ac3e91b23002b980df6f8 Mon Sep 17 00:00:00 2001 From: Bambarini <109903165+Bambarini@users.noreply.github.com> Date: Thu, 28 Jul 2022 15:30:29 +0200 Subject: [PATCH] Show languages of providers in alphabetical order to make it consistent with app language selector (#1357) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Paweł --- .../com/lagradost/cloudstream3/ui/settings/SettingsLang.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsLang.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsLang.kt index 2f047cf7..6265771c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsLang.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsLang.kt @@ -52,7 +52,7 @@ class SettingsLang : PreferenceFragmentCompat() { private fun getCurrentLocale(): String { val res = requireContext().resources -// Change locale settings in the app. + // Change locale settings in the app. // val dm = res.displayMetrics val conf = res.configuration return conf?.locale?.language ?: "en" @@ -149,10 +149,11 @@ class SettingsLang : PreferenceFragmentCompat() { getPref(R.string.provider_lang_key)?.setOnPreferenceClickListener { activity?.getApiProviderLangSettings()?.let { current -> - val allLangs = HashSet() + var allLangs: MutableSet = mutableSetOf() for (api in APIHolder.apis) { allLangs.add(api.lang) } + allLangs = allLangs.sortedBy { SubtitleHelper.fromTwoLettersToLanguage(it) }.toMutableSet() val currentList = ArrayList() for (i in current) {