mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 06:29:17 +01:00
Fix crash when editing categories for global update or downloads
Fixes #949
This commit is contained in:
parent
372830b6d4
commit
1ce5f50d89
@ -60,18 +60,12 @@ 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, _ ->
|
||||||
|
currentSelection[index] != 0
|
||||||
|
}
|
||||||
selection?.invoke(dialog, currentSelection, selectedItems)
|
selection?.invoke(dialog, currentSelection, selectedItems)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal inline fun <reified T> List<T>.pullIndices(indices: IntArray): List<T> {
|
|
||||||
return mutableListOf<T>().apply {
|
|
||||||
for (index in indices) {
|
|
||||||
add(this@pullIndices[index])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreateViewHolder(
|
override fun onCreateViewHolder(
|
||||||
parent: ViewGroup,
|
parent: ViewGroup,
|
||||||
viewType: Int
|
viewType: Int
|
||||||
|
Loading…
Reference in New Issue
Block a user