From ace3147479f2d8eb5224bfa1dc41c1f745714411 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 30 Oct 2019 21:10:31 -0700 Subject: [PATCH] Reader seekbar now above gesture area Co-Authored-By: tonarii --- .../eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 11 +++++++++++ .../eu/kanade/tachiyomi/ui/reader/ReaderSeekBar.kt | 12 ------------ 2 files changed, 11 insertions(+), 12 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 84265bcd98..19708c97a6 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 @@ -145,6 +145,17 @@ class ReaderActivity : BaseRxActivity() { config = ReaderConfig() initializeMenu() + val container: ViewGroup = findViewById(R.id.reader_container) + val readerBHeight = reader_menu_bottom.layoutParams.height + container.doOnApplyWindowInsets { _, insets, padding -> + val bottomInset = if (Build.VERSION.SDK_INT >= 29) + (insets.mandatorySystemGestureInsets.bottom - insets.systemWindowInsetBottom) + else 0 + reader_menu_bottom.updateLayoutParams { + height = readerBHeight + bottomInset + } + reader_menu_bottom.updatePaddingRelative(bottom = padding.bottom + bottomInset) + } } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSeekBar.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSeekBar.kt index 48aeb56d32..255367d3c4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSeekBar.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSeekBar.kt @@ -20,8 +20,6 @@ class ReaderSeekBar @JvmOverloads constructor( * Whether the seekbar should draw from right to left. */ var isRTL = false - private val boundingBox: Rect = Rect() - private val exclusions = listOf(boundingBox) /** * Draws the seekbar, translating the canvas if using a right to left reader. @@ -45,14 +43,4 @@ class ReaderSeekBar @JvmOverloads constructor( } return super.onTouchEvent(event) } - - override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) { - super.onLayout(changed, left, top, right, bottom) - if (Build.VERSION.SDK_INT >= 29) { - if (changed) { - boundingBox.set(left, top, right, bottom) - systemGestureExclusionRects = exclusions - } - } - } }