Show languages of providers in alphabetical order to make it consistent with app language selector (#1357)

Co-authored-by: Paweł <pawelmaczalowski@gmail.com>
This commit is contained in:
Bambarini 2022-07-28 15:30:29 +02:00 committed by GitHub
parent e54c951bb6
commit 4ac7e0c967
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -149,10 +149,11 @@ class SettingsLang : PreferenceFragmentCompat() {
getPref(R.string.provider_lang_key)?.setOnPreferenceClickListener { getPref(R.string.provider_lang_key)?.setOnPreferenceClickListener {
activity?.getApiProviderLangSettings()?.let { current -> activity?.getApiProviderLangSettings()?.let { current ->
val allLangs = HashSet<String>() var allLangs: MutableSet<String> = mutableSetOf()
for (api in APIHolder.apis) { for (api in APIHolder.apis) {
allLangs.add(api.lang) allLangs.add(api.lang)
} }
allLangs = allLangs.sortedBy { SubtitleHelper.fromTwoLettersToLanguage(it) }.toMutableSet()
val currentList = ArrayList<Int>() val currentList = ArrayList<Int>()
for (i in current) { for (i in current) {