feat(YouTube - Settings): Sort preference screens below other types of preference
This commit is contained in:
parent
14ea9674c4
commit
9561db50a8
|
@ -32,17 +32,25 @@ abstract class AbstractPreferenceScreen(
|
|||
preferences: MutableList<BasePreference> = mutableListOf(),
|
||||
val categories: MutableList<Category> = mutableListOf()
|
||||
) : BasePreferenceCollection(key, title, preferences) {
|
||||
override fun transform(): PreferenceScreen {
|
||||
return PreferenceScreen(
|
||||
override fun transform() = PreferenceScreen(
|
||||
key,
|
||||
StringResource("${key}_title", title),
|
||||
preferences.sortedBy { it.title.value.removePunctuation().lowercase() } +
|
||||
categories.sortedBy { it.title.removePunctuation().lowercase() }.map { it.transform() },
|
||||
StringResource(
|
||||
"${key}_title", title
|
||||
),
|
||||
preferences.sortedWith(
|
||||
compareBy(
|
||||
{ it is PreferenceScreen },
|
||||
{ it.title.value.removePunctuation().lowercase() }
|
||||
)
|
||||
) + categories.sortedBy {
|
||||
it.title.removePunctuation().lowercase()
|
||||
}.map {
|
||||
it.transform()
|
||||
},
|
||||
summary?.let { summary ->
|
||||
StringResource("${key}_summary", summary)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun ensureScreenInserted() {
|
||||
// Add to screens if not yet done
|
||||
|
|
Loading…
Reference in a new issue