Skip to content

Commit 377ee5a

Browse files
Set navigation bar padding on the content, not the sheet container (#661)
1 parent 1c411cb commit 377ee5a

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

gravatar-quickeditor/src/main/java/com/gravatar/quickeditor/ui/editor/bottomsheet/GravatarQuickEditorBottomSheet.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,17 +275,12 @@ private fun GravatarModalBottomSheet(
275275
},
276276
),
277277
) {
278-
val paddingValues = WindowInsets.navigationBars
279-
.only(WindowInsetsSides.Vertical)
280-
.asPaddingValues()
281278
Sheet(
282279
modifier = Modifier
283280
.clip(RoundedCornerShape(topStart = 28.dp, topEnd = 28.dp))
284281
.background(MaterialTheme.colorScheme.surfaceColorAtElevation(1.dp))
285282
.widthIn(max = 640.dp)
286-
.fillMaxWidth()
287-
.padding(paddingValues)
288-
.consumeWindowInsets(paddingValues),
283+
.fillMaxWidth(),
289284
) {
290285
val window = LocalModalWindow.current
291286
val isDarkTheme = isSystemInDarkTheme()
@@ -294,12 +289,19 @@ private fun GravatarModalBottomSheet(
294289
WindowInsetsControllerCompat(window, window.decorView).isAppearanceLightNavigationBars =
295290
!isDarkTheme
296291
}
292+
297293
Surface(
298294
modifier = Modifier
299295
.fillMaxWidth(),
300296
) {
297+
val paddingValues = WindowInsets.navigationBars
298+
.only(WindowInsetsSides.Vertical)
299+
.asPaddingValues()
301300
Column(
302301
horizontalAlignment = Alignment.CenterHorizontally,
302+
modifier = Modifier
303+
.padding(paddingValues)
304+
.consumeWindowInsets(paddingValues),
303305
) {
304306
content()
305307
}

0 commit comments

Comments
 (0)