Sort sources/extensions filter languages

This commit is contained in:
arkon
2020-05-31 15:05:24 -04:00
parent 7dd9a0211b
commit 0bf14fd31c
4 changed files with 10 additions and 13 deletions
@@ -30,8 +30,7 @@ class SettingsSourcesController : SettingsController() {
val sourcesByLang = onlineSources.groupByTo(TreeMap(), { it.lang })
// Order first by active languages, then inactive ones
val orderedLangs = sourcesByLang.keys.filter { it in activeLangsCodes } +
sourcesByLang.keys.filterNot { it in activeLangsCodes }
val orderedLangs = sourcesByLang.keys.sortedWith(compareBy({ it !in activeLangsCodes }, { LocaleHelper.getSourceDisplayName(it, context) }))
orderedLangs.forEach { lang ->
val sources = sourcesByLang[lang].orEmpty().sortedBy { it.name }