mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-18 23:49:18 +01:00
Fix clear database selection toggling (fixes #6807)
This commit is contained in:
parent
c06ad8b87e
commit
85be4c492d
@ -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 New Issue
Block a user