mirror of
https://github.com/ev-map/EVMap.git
synced 2026-04-23 07:36:59 -04:00
MultiSelectDialog: put common choices on top even when selected
This commit is contained in:
@@ -81,9 +81,10 @@ class MultiSelectDialog : AppCompatDialogFragment() {
|
||||
.sortedBy { it.value.toLowerCase(Locale.getDefault()) }
|
||||
.sortedBy {
|
||||
when {
|
||||
selected.contains(it.key) -> 0
|
||||
commonChoices?.contains(it.key) == true -> 1
|
||||
else -> 2
|
||||
selected.contains(it.key) && commonChoices?.contains(it.key) == true -> 0
|
||||
selected.contains(it.key) -> 1
|
||||
commonChoices?.contains(it.key) == true -> 2
|
||||
else -> 3
|
||||
}
|
||||
}
|
||||
.map { MultiSelectItem(it.key, it.value, it.key in selected) }
|
||||
|
||||
Reference in New Issue
Block a user