From 791b94e7a3668f30e4c567baa1aa5bc895f2a73c Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Mon, 22 Mar 2021 18:42:39 -0400 Subject: [PATCH] Fix rounded corners of bottom sheets Also setting notch mode to never show in landscape Also also fixing tracking bottom sheet from passing the status bar in landscape --- .../tachiyomi/ui/manga/track/TrackingBottomSheet.kt | 4 +++- .../java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt | 8 ++++---- app/src/main/res/values-v27/styles.xml | 3 --- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackingBottomSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackingBottomSheet.kt index e6b6786da9..f25767f64a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackingBottomSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackingBottomSheet.kt @@ -1,6 +1,8 @@ package eu.kanade.tachiyomi.ui.manga.track import android.content.Intent +import android.graphics.Color +import android.graphics.drawable.ColorDrawable import android.os.Bundle import android.view.View import android.view.ViewGroup @@ -43,7 +45,7 @@ class TrackingBottomSheet(private val controller: MangaDetailsController) : setContentView(view) sheetBehavior = BottomSheetBehavior.from(view.parent as ViewGroup) - setEdgeToEdge(activity, view) + setEdgeToEdge(activity, view, 0) val height = activity.window.decorView.rootWindowInsets.systemWindowInsetBottom sheetBehavior.peekHeight = 500.dpToPx + height diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt index 34ca1f0d9c..b04b8f5a67 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt @@ -258,10 +258,10 @@ fun BottomSheetDialog.setEdgeToEdge( .SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION val insets = activity.window.decorView.rootWindowInsets - (contentView.parent as View).translationX = ( - insets.systemWindowInsetLeft - insets - .systemWindowInsetRight - ).toFloat() / 2f + (contentView.parent as View).background = null + contentView.post { + (contentView.parent as View).background = null + } if (setTopMargin > 0) (contentView.parent as View).updateLayoutParams { height = activity.window.decorView.height - insets.systemWindowInsetTop - setTopMargin } diff --git a/app/src/main/res/values-v27/styles.xml b/app/src/main/res/values-v27/styles.xml index 734630a9ad..2fca243ad9 100644 --- a/app/src/main/res/values-v27/styles.xml +++ b/app/src/main/res/values-v27/styles.xml @@ -5,15 +5,12 @@ \ No newline at end of file