From 6864f32eca8d118423f7d2f99fa2a32829cc23a6 Mon Sep 17 00:00:00 2001 From: theov Date: Thu, 28 May 2026 02:26:07 -0300 Subject: [PATCH] ui: adjust insets and padding for LyricsMoreBottomSheet Updates the `LyricsMoreBottomSheet` to manually handle window insets and bottom padding, ensuring the content is correctly positioned relative to the navigation bar. - Overrode default `contentWindowInsets` in `ModalBottomSheet` to prevent automatic inset handling. - Added `navigationBarsPadding` to the bottom padding of the main container. - Integrated `LocalConfiguration` to calculate screen height for future layout constraints. --- .../components/subcomps/LyricsMoreBottomSheet.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/theveloper/pixelplay/presentation/components/subcomps/LyricsMoreBottomSheet.kt b/app/src/main/java/com/theveloper/pixelplay/presentation/components/subcomps/LyricsMoreBottomSheet.kt index 4b73a4727..7c6b702bd 100644 --- a/app/src/main/java/com/theveloper/pixelplay/presentation/components/subcomps/LyricsMoreBottomSheet.kt +++ b/app/src/main/java/com/theveloper/pixelplay/presentation/components/subcomps/LyricsMoreBottomSheet.kt @@ -13,9 +13,11 @@ import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.asPaddingValues import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.navigationBars import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.rounded.FormatAlignLeft import androidx.compose.material.icons.automirrored.rounded.FormatAlignRight @@ -106,13 +108,16 @@ fun LyricsMoreBottomSheet( sheetState = sheetState, containerColor = containerColor, contentColor = contentColor, - shape = RoundedCornerShape(topStart = 28.dp, topEnd = 28.dp) + shape = RoundedCornerShape(topStart = 28.dp, topEnd = 28.dp), + contentWindowInsets = { WindowInsets(top = 0, bottom = 0) } ) { + val screenHeight = LocalConfiguration.current.screenHeightDp.dp Column( modifier = Modifier .fillMaxWidth() + //.heightIn(max = screenHeight * 0.85f) .padding(horizontal = 16.dp) - .padding(bottom = 24.dp) + .padding(bottom = 24.dp + navigationBarsPadding) .verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(10.dp) ) {