From f498aaa64278be978ccd00dea8ab4bdbc8b70c12 Mon Sep 17 00:00:00 2001 From: Theodoro Mota Date: Sun, 21 Jan 2024 18:47:48 -0300 Subject: [PATCH 1/2] replace the windowInsetsPadding for navigationBarsPadding + statusBarsPadding --- .../presentation/core/components/AdaptiveSheet.kt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/components/AdaptiveSheet.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/AdaptiveSheet.kt index d36e2593f1..515faec141 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/components/AdaptiveSheet.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/AdaptiveSheet.kt @@ -11,17 +11,14 @@ import androidx.compose.foundation.gestures.anchoredDraggable import androidx.compose.foundation.gestures.animateTo import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.WindowInsets -import androidx.compose.foundation.layout.WindowInsetsSides import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.offset -import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.requiredWidthIn -import androidx.compose.foundation.layout.systemBars +import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.layout.systemBarsPadding import androidx.compose.foundation.layout.widthIn -import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.runtime.Composable @@ -177,10 +174,8 @@ fun AdaptiveSheet( orientation = Orientation.Vertical, enabled = enableSwipeDismiss, ) - .windowInsetsPadding( - WindowInsets.systemBars - .only(WindowInsetsSides.Top + WindowInsetsSides.Horizontal), - ), + .navigationBarsPadding() + .statusBarsPadding(), shape = MaterialTheme.shapes.extraLarge, tonalElevation = tonalElevation, content = { From e0b3b985036c24825d97a6602b82aaedac7bb56c Mon Sep 17 00:00:00 2001 From: Theodoro Mota Date: Sun, 21 Jan 2024 19:16:32 -0300 Subject: [PATCH 2/2] Setting decorFitsSystemWindows = true to fix ui bug on Android 11 --- .../java/eu/kanade/presentation/components/AdaptiveSheet.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/presentation/components/AdaptiveSheet.kt b/app/src/main/java/eu/kanade/presentation/components/AdaptiveSheet.kt index b3d07c1c3c..2712d9a279 100644 --- a/app/src/main/java/eu/kanade/presentation/components/AdaptiveSheet.kt +++ b/app/src/main/java/eu/kanade/presentation/components/AdaptiveSheet.kt @@ -97,5 +97,5 @@ fun AdaptiveSheet( private val dialogProperties = DialogProperties( usePlatformDefaultWidth = false, - decorFitsSystemWindows = false, + decorFitsSystemWindows = true, )