Fixed mark as unread not showing

This commit is contained in:
Jay 2020-05-01 17:58:54 -04:00
parent 25daf1919a
commit 54a0c3fded
2 changed files with 3 additions and 3 deletions

View File

@ -316,7 +316,7 @@ class MangaDetailsController : BaseController,
}
private fun setInsets(insets: WindowInsets, appbarHeight: Int, offset: Int) {
recycler.updatePaddingRelative(bottom = insets.systemWindowInsetBottom)
recycler?.updatePaddingRelative(bottom = insets.systemWindowInsetBottom)
tabletRecycler?.updatePaddingRelative(bottom = insets.systemWindowInsetBottom)
headerHeight = appbarHeight + insets.systemWindowInsetTop
swipe_refresh.setProgressViewOffset(false, (-40).dpToPx, headerHeight + offset)
@ -823,7 +823,7 @@ class MangaDetailsController : BaseController,
menu.findItem(R.id.action_mark_all_as_read).isVisible =
presenter.getNextUnreadChapter() != null && !presenter.isLockedFromSearch
menu.findItem(R.id.action_mark_all_as_unread).isVisible =
presenter.anyUnread() && !presenter.isLockedFromSearch
presenter.anyRead() && !presenter.isLockedFromSearch
menu.findItem(R.id.action_remove_downloads).isVisible =
presenter.hasDownloads() && !presenter.isLockedFromSearch &&
manga?.source != LocalSource.ID

View File

@ -320,7 +320,7 @@ class MangaDetailsPresenter(
return chapters.sortedByDescending { it.source_order }.find { !it.read }
}
fun anyUnread(): Boolean = chapters.any { !it.read }
fun anyRead(): Boolean = chapters.any { it.read }
fun hasBookmark(): Boolean = chapters.any { it.bookmark }
fun hasDownloads(): Boolean = chapters.any { it.isDownloaded }