mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 05:05:08 +01:00
Fixed crash with recents swiping
This commit is contained in:
parent
7a03231ede
commit
79d8d6ba8d
@ -9,7 +9,6 @@ class RecentChaptersAdapter(val controller: RecentChaptersController) :
|
||||
|
||||
val coverClickListener: OnCoverClickListener = controller
|
||||
var recents = emptyList<RecentChapterItem>()
|
||||
private var isAnimating = false
|
||||
|
||||
init {
|
||||
setDisplayHeadersAtStartUp(true)
|
||||
@ -24,11 +23,10 @@ class RecentChaptersAdapter(val controller: RecentChaptersController) :
|
||||
fun performFilter() {
|
||||
val s = getFilter(String::class.java)
|
||||
if (s.isNullOrBlank()) {
|
||||
updateDataSet(recents, isAnimating)
|
||||
updateDataSet(recents)
|
||||
} else {
|
||||
updateDataSet(recents.filter { it.filter(s) }, isAnimating)
|
||||
updateDataSet(recents.filter { it.filter(s) })
|
||||
}
|
||||
isAnimating = false
|
||||
}
|
||||
|
||||
interface OnCoverClickListener {
|
||||
@ -37,7 +35,6 @@ class RecentChaptersAdapter(val controller: RecentChaptersController) :
|
||||
|
||||
override fun onItemSwiped(position: Int, direction: Int) {
|
||||
super.onItemSwiped(position, direction)
|
||||
isAnimating = true
|
||||
when (direction) {
|
||||
ItemTouchHelper.LEFT -> controller.toggleMarkAsRead(position)
|
||||
}
|
||||
|
@ -9,14 +9,12 @@ import java.text.DecimalFormatSymbols
|
||||
class RecentMangaAdapter(val delegate: RecentsInterface) :
|
||||
BaseChapterAdapter<IFlexible<*>>(delegate) {
|
||||
|
||||
private var isAnimating = false
|
||||
init {
|
||||
setDisplayHeadersAtStartUp(true)
|
||||
}
|
||||
|
||||
fun updateItems(items: List<IFlexible<*>>?) {
|
||||
updateDataSet(items, isAnimating)
|
||||
isAnimating = false
|
||||
updateDataSet(items)
|
||||
}
|
||||
|
||||
val decimalFormat = DecimalFormat("#.###", DecimalFormatSymbols()
|
||||
@ -34,7 +32,6 @@ class RecentMangaAdapter(val delegate: RecentsInterface) :
|
||||
|
||||
override fun onItemSwiped(position: Int, direction: Int) {
|
||||
super.onItemSwiped(position, direction)
|
||||
isAnimating = true
|
||||
when (direction) {
|
||||
ItemTouchHelper.LEFT -> delegate.markAsRead(position)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user