Fix clear database selection toggling (fixes #6807)
(cherry picked from commit 85be4c492d851a1419edd33c910f6b2614de38dd)
This commit is contained in:
parent
704b3b0508
commit
46bb17ce81
1 changed files with 3 additions and 5 deletions
|
|
@ -88,11 +88,9 @@ class ClearDatabaseController :
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
R.id.action_select_all -> adapter.selectAll()
|
R.id.action_select_all -> adapter.selectAll()
|
||||||
R.id.action_select_inverse -> {
|
R.id.action_select_inverse -> {
|
||||||
val currentSelection = adapter.selectedPositionsAsSet
|
adapter.currentItems.forEachIndexed { index, _ ->
|
||||||
val invertedSelection = (0..adapter.itemCount)
|
adapter.toggleSelection(index)
|
||||||
.filterNot { currentSelection.contains(it) }
|
}
|
||||||
currentSelection.clear()
|
|
||||||
currentSelection.addAll(invertedSelection)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateFab()
|
updateFab()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue