mirror of
https://github.com/ev-map/EVMap.git
synced 2026-04-22 15:19:19 -04:00
@@ -79,7 +79,13 @@ class MultiSelectDialog : AppCompatDialogFragment() {
|
||||
|
||||
items = data.entries.toList()
|
||||
.sortedBy { it.value.toLowerCase(Locale.getDefault()) }
|
||||
.sortedByDescending { commonChoices?.contains(it.key) == true }
|
||||
.sortedBy {
|
||||
when {
|
||||
selected.contains(it.key) -> 0
|
||||
commonChoices?.contains(it.key) == true -> 1
|
||||
else -> 2
|
||||
}
|
||||
}
|
||||
.map { MultiSelectItem(it.key, it.value, it.key in selected) }
|
||||
adapter.submitList(items)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user