mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 06:09:19 +01:00
Fix crash when editing categories for global update or downloads
Fixes #949
This commit is contained in:
parent
372830b6d4
commit
1ce5f50d89
@ -60,16 +60,10 @@ internal class QuadStateMultiChoiceDialogAdapter(
|
|||||||
else -> QuadStateCheckBox.State.CHECKED.ordinal
|
else -> QuadStateCheckBox.State.CHECKED.ordinal
|
||||||
}
|
}
|
||||||
currentSelection = newSelection.toIntArray()
|
currentSelection = newSelection.toIntArray()
|
||||||
val selectedItems = this.items.pullIndices(this.currentSelection)
|
val selectedItems = this.items.filterIndexed { index, _ ->
|
||||||
selection?.invoke(dialog, currentSelection, selectedItems)
|
currentSelection[index] != 0
|
||||||
}
|
|
||||||
|
|
||||||
internal inline fun <reified T> List<T>.pullIndices(indices: IntArray): List<T> {
|
|
||||||
return mutableListOf<T>().apply {
|
|
||||||
for (index in indices) {
|
|
||||||
add(this@pullIndices[index])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
selection?.invoke(dialog, currentSelection, selectedItems)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateViewHolder(
|
override fun onCreateViewHolder(
|
||||||
|
Loading…
Reference in New Issue
Block a user