diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt index 5b65297f82..ce08f453f2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt @@ -59,6 +59,8 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr post { chapter_recycler.alpha = if (sheetBehavior.isExpanded()) 1f else 0f + chapter_recycler.isClickable = sheetBehavior.isExpanded() + chapter_recycler.isFocusable = sheetBehavior.isExpanded() } sheetBehavior?.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() { @@ -95,6 +97,8 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr webview_button.alpha = 1f if (activity.sheetManageNavColor) activity.window.navigationBarColor = primary } + chapter_recycler.isClickable = state == BottomSheetBehavior.STATE_EXPANDED + chapter_recycler.isFocusable = state == BottomSheetBehavior.STATE_EXPANDED webview_button.visibleIf(state != BottomSheetBehavior.STATE_COLLAPSED) chapters_button.visInvisIf(state != BottomSheetBehavior.STATE_EXPANDED) } @@ -103,11 +107,15 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr adapter = FastAdapter.with(itemAdapter) chapter_recycler.adapter = adapter adapter?.onClickListener = { _, _, item, _ -> - if (item.chapter.id != presenter.getCurrentChapter()?.chapter?.id) { - shouldCollapse = false - presenter.loadChapter(item.chapter) + if (!sheetBehavior.isExpanded()) { + false + } else { + if (item.chapter.id != presenter.getCurrentChapter()?.chapter?.id) { + shouldCollapse = false + presenter.loadChapter(item.chapter) + } + true } - true } adapter?.addEventHook(object : ClickEventHook() { override fun onBind(viewHolder: RecyclerView.ViewHolder): View? {