mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 17:41:50 +01:00
Fix recent item not showing after swiped
This commit is contained in:
parent
f297444d19
commit
e87f0c48ce
@ -9,10 +9,16 @@ 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
|
||||
}
|
||||
|
||||
val decimalFormat = DecimalFormat("#.###", DecimalFormatSymbols()
|
||||
.apply { decimalSeparator = '.' })
|
||||
|
||||
@ -28,6 +34,7 @@ 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)
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ class RecentMangaItem(
|
||||
}
|
||||
|
||||
override fun isSwipeable(): Boolean {
|
||||
return mch.manga.id != null
|
||||
return mch.manga.id != null && !chapter.read
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
|
@ -227,7 +227,7 @@ class RecentsController(bundle: Bundle? = null) : BaseController(bundle),
|
||||
|
||||
fun showLists(recents: List<RecentMangaItem>) {
|
||||
swipe_refresh.isRefreshing = LibraryUpdateService.isRunning()
|
||||
adapter.updateDataSet(recents)
|
||||
adapter.updateItems(recents)
|
||||
adapter.removeAllScrollableHeaders()
|
||||
if (presenter.viewType > 0)
|
||||
adapter.addScrollableHeader(presenter.generalHeader)
|
||||
|
Loading…
Reference in New Issue
Block a user