mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-24 00:51:47 +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) :
|
class RecentMangaAdapter(val delegate: RecentsInterface) :
|
||||||
BaseChapterAdapter<IFlexible<*>>(delegate) {
|
BaseChapterAdapter<IFlexible<*>>(delegate) {
|
||||||
|
|
||||||
|
private var isAnimating = false
|
||||||
init {
|
init {
|
||||||
setDisplayHeadersAtStartUp(true)
|
setDisplayHeadersAtStartUp(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun updateItems(items: List<IFlexible<*>>?) {
|
||||||
|
updateDataSet(items, isAnimating)
|
||||||
|
isAnimating = false
|
||||||
|
}
|
||||||
|
|
||||||
val decimalFormat = DecimalFormat("#.###", DecimalFormatSymbols()
|
val decimalFormat = DecimalFormat("#.###", DecimalFormatSymbols()
|
||||||
.apply { decimalSeparator = '.' })
|
.apply { decimalSeparator = '.' })
|
||||||
|
|
||||||
@ -28,6 +34,7 @@ class RecentMangaAdapter(val delegate: RecentsInterface) :
|
|||||||
|
|
||||||
override fun onItemSwiped(position: Int, direction: Int) {
|
override fun onItemSwiped(position: Int, direction: Int) {
|
||||||
super.onItemSwiped(position, direction)
|
super.onItemSwiped(position, direction)
|
||||||
|
isAnimating = true
|
||||||
when (direction) {
|
when (direction) {
|
||||||
ItemTouchHelper.LEFT -> delegate.markAsRead(position)
|
ItemTouchHelper.LEFT -> delegate.markAsRead(position)
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ class RecentMangaItem(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun isSwipeable(): Boolean {
|
override fun isSwipeable(): Boolean {
|
||||||
return mch.manga.id != null
|
return mch.manga.id != null && !chapter.read
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
|
@ -227,7 +227,7 @@ class RecentsController(bundle: Bundle? = null) : BaseController(bundle),
|
|||||||
|
|
||||||
fun showLists(recents: List<RecentMangaItem>) {
|
fun showLists(recents: List<RecentMangaItem>) {
|
||||||
swipe_refresh.isRefreshing = LibraryUpdateService.isRunning()
|
swipe_refresh.isRefreshing = LibraryUpdateService.isRunning()
|
||||||
adapter.updateDataSet(recents)
|
adapter.updateItems(recents)
|
||||||
adapter.removeAllScrollableHeaders()
|
adapter.removeAllScrollableHeaders()
|
||||||
if (presenter.viewType > 0)
|
if (presenter.viewType > 0)
|
||||||
adapter.addScrollableHeader(presenter.generalHeader)
|
adapter.addScrollableHeader(presenter.generalHeader)
|
||||||
|
Loading…
Reference in New Issue
Block a user