From ecec1bd10295dc967cb39dfaa4c18a0d5b0bfa90 Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 3 Aug 2020 16:52:28 -0400 Subject: [PATCH] Revert "Use insetter library for handling inset padding" (fixes #3586) This reverts commit 3ddd1033c32d8e051f048a4b7a1911f55b37a501. --- app/build.gradle | 2 -- .../tachiyomi/ui/reader/ReaderActivity.kt | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3a062b60fb..7aea20eb66 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -153,8 +153,6 @@ dependencies { // UI library implementation 'com.google.android.material:material:1.3.0-alpha02' - implementation 'dev.chrisbanes:insetter-ktx:0.3.1' - standardImplementation 'com.google.firebase:firebase-core:17.4.4' // ReactiveX 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 6ff97c1c03..6439071e59 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 @@ -20,11 +20,11 @@ import android.view.WindowManager import android.view.animation.Animation import android.view.animation.AnimationUtils import android.widget.SeekBar +import androidx.core.view.ViewCompat import androidx.core.view.isVisible import androidx.core.view.setPadding import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView import com.google.android.material.snackbar.Snackbar -import dev.chrisbanes.insetter.applySystemWindowInsetsToPadding import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Manga @@ -288,13 +288,16 @@ class ReaderActivity : BaseRxActivity() onBackPressed() } - if (!window.isDefaultBar()) { - binding.readerMenu.applySystemWindowInsetsToPadding( - left = true, - top = true, - right = true, - bottom = true - ) + ViewCompat.setOnApplyWindowInsetsListener(binding.readerMenu) { _, insets -> + if (!window.isDefaultBar()) { + binding.readerMenu.setPadding( + insets.systemWindowInsetLeft, + insets.systemWindowInsetTop, + insets.systemWindowInsetRight, + insets.systemWindowInsetBottom + ) + } + insets } // Init listeners on bottom menu