From 053a5149c20f652179fa7649c211a8fffcb86921 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Thu, 15 Apr 2021 01:05:50 -0400 Subject: [PATCH] Possibly Fix reader bottom sheet sometimes not showwing --- .../eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index 25d0dc0b5a..fbac8a0cd9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -63,6 +63,7 @@ import eu.kanade.tachiyomi.util.system.GLUtil import eu.kanade.tachiyomi.util.system.ThemeUtil import eu.kanade.tachiyomi.util.system.contextCompatColor import eu.kanade.tachiyomi.util.system.dpToPx +import eu.kanade.tachiyomi.util.system.getBottomGestureInsets import eu.kanade.tachiyomi.util.system.getPrefTheme import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.hasSideNavBar @@ -653,6 +654,8 @@ class ReaderActivity : setMenuVisibility(menuVisible) binding.chaptersSheet.chaptersBottomSheet.sheetBehavior?.isHideable = !menuVisible if (!menuVisible) binding.chaptersSheet.chaptersBottomSheet.sheetBehavior?.hide() + binding.chaptersSheet.root.sheetBehavior?.isGestureInsetBottomIgnored = true + val peek = 50.dpToPx binding.readerLayout.doOnApplyWindowInsets { v, insets, _ -> sheetManageNavColor = when { insets.isBottomTappable() -> { @@ -685,11 +688,8 @@ class ReaderActivity : leftMargin = 12.dpToPx + insets.systemWindowInsetLeft rightMargin = 12.dpToPx + insets.systemWindowInsetRight } - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { - val peek = 50.dpToPx - binding.chaptersSheet.root.sheetBehavior?.peekHeight = - peek + insets.systemWindowInsetBottom - } + binding.chaptersSheet.root.sheetBehavior?.peekHeight = + peek + insets.getBottomGestureInsets() binding.chaptersSheet.chapterRecycler.updatePaddingRelative(bottom = insets.systemWindowInsetBottom) binding.viewerContainer.requestLayout() }