mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
Fix selection state appearance in clear database list (fixes #6526)
This commit is contained in:
parent
bf3bb8a378
commit
8c4ece4b2d
1 changed files with 1 additions and 7 deletions
|
@ -24,11 +24,7 @@ data class ClearDatabaseSourceItem(val source: Source, private val mangaCount: I
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun bindViewHolder(adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>?, holder: Holder?, position: Int, payloads: MutableList<Any>?) {
|
override fun bindViewHolder(adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>?, holder: Holder?, position: Int, payloads: MutableList<Any>?) {
|
||||||
if (payloads.isNullOrEmpty()) {
|
holder?.bind(source, mangaCount)
|
||||||
holder?.bind(source, mangaCount)
|
|
||||||
} else {
|
|
||||||
holder?.updateCheckbox()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Holder(view: View, adapter: FlexibleAdapter<*>) : FlexibleViewHolder(view, adapter) {
|
class Holder(view: View, adapter: FlexibleAdapter<*>) : FlexibleViewHolder(view, adapter) {
|
||||||
|
@ -46,9 +42,7 @@ data class ClearDatabaseSourceItem(val source: Source, private val mangaCount: I
|
||||||
source.icon() != null -> binding.thumbnail.setImageDrawable(source.icon())
|
source.icon() != null -> binding.thumbnail.setImageDrawable(source.icon())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fun updateCheckbox() {
|
|
||||||
binding.checkbox.isChecked = (bindingAdapter as FlexibleAdapter<*>).isSelected(bindingAdapterPosition)
|
binding.checkbox.isChecked = (bindingAdapter as FlexibleAdapter<*>).isSelected(bindingAdapterPosition)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue