mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 05:25:04 +01:00
Fixed fading out of header every time an item is selected in single list mode
This commit is contained in:
parent
8379c69874
commit
0337181b08
@ -263,6 +263,7 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun setSelection(manga: Manga, selected: Boolean) {
|
override fun setSelection(manga: Manga, selected: Boolean) {
|
||||||
|
val currentMode = adapter.mode
|
||||||
if (selected) {
|
if (selected) {
|
||||||
if (selectedMangas.add(manga)) {
|
if (selectedMangas.add(manga)) {
|
||||||
val positions = adapter.allIndexOf(manga)
|
val positions = adapter.allIndexOf(manga)
|
||||||
@ -292,13 +293,18 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateHeaders()
|
updateHeaders(currentMode != adapter.mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateHeaders() {
|
private fun updateHeaders(changedMode: Boolean = false) {
|
||||||
val headerPositions = adapter.getHeaderPositions()
|
val headerPositions = adapter.getHeaderPositions()
|
||||||
headerPositions.forEach {
|
headerPositions.forEach {
|
||||||
adapter.notifyItemChanged(it)
|
if (changedMode) {
|
||||||
|
adapter.notifyItemChanged(it)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
(recycler.findViewHolderForAdapterPosition(it) as? LibraryHeaderItem.Holder)?.setSelection()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user