From 72a74ea48858049deedf0c2e0a0d5767b74d09ad Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Mon, 12 Jul 2021 15:09:01 -0400 Subject: [PATCH] Fixed sidenav's padding since google doesn't know how to --- .../eu/kanade/tachiyomi/ui/main/MainActivity.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 3a4e1b1da7..55e124b954 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -28,6 +28,7 @@ import androidx.core.content.ContextCompat import androidx.core.graphics.ColorUtils import androidx.core.net.toUri import androidx.core.view.GestureDetectorCompat +import androidx.core.view.ViewCompat import androidx.core.view.isVisible import androidx.lifecycle.lifecycleScope import com.bluelinelabs.conductor.Conductor @@ -233,18 +234,18 @@ open class MainActivity : BaseActivity(), DownloadServiceLi ) binding.bottomNav?.updatePadding(bottom = insets.systemWindowInsetBottom) binding.sideNav?.updatePadding( - left = insets.systemWindowInsetLeft, - right = insets.systemWindowInsetRight + left = 0, + right = 0, + bottom = insets.systemWindowInsetBottom, + top = insets.systemWindowInsetTop ) - binding.sideNav?.updateLayoutParams { - topMargin = insets.systemWindowInsetTop - topMargin = insets.systemWindowInsetBottom - } binding.bottomView?.isVisible = insets.systemWindowInsetBottom > 0 binding.bottomView?.updateLayoutParams { height = insets.systemWindowInsetBottom } } + // Set this as nav view will try to set its own insets and they're hilariously bad + ViewCompat.setOnApplyWindowInsetsListener(nav) { _, insets -> insets } router = Conductor.attachRouter(this, container, savedInstanceState)