From af4710370727511bd65f1f96dc6fd47bb245c4e1 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 12 Sep 2020 15:39:51 -0400 Subject: [PATCH] Replace deprecated system window insets usage --- .../eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 6439071e59..b6ccb9b0f1 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 @@ -21,6 +21,7 @@ import android.view.animation.Animation import android.view.animation.AnimationUtils import android.widget.SeekBar import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat import androidx.core.view.isVisible import androidx.core.view.setPadding import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView @@ -290,11 +291,12 @@ class ReaderActivity : BaseRxActivity() ViewCompat.setOnApplyWindowInsetsListener(binding.readerMenu) { _, insets -> if (!window.isDefaultBar()) { + val systemInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) binding.readerMenu.setPadding( - insets.systemWindowInsetLeft, - insets.systemWindowInsetTop, - insets.systemWindowInsetRight, - insets.systemWindowInsetBottom + systemInsets.left, + systemInsets.top, + systemInsets.right, + systemInsets.bottom ) } insets