Skip to content

Commit

Permalink
Fix feed info bottom sheet window insets
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed Feb 7, 2024
1 parent 335df0e commit a303a9f
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ fun FeedInfoBottomSheet(
}
}

// Doing this before `ModalBottomSheet` as this value is not available
// after `ModalSheetConsumes` insets, I think? It's returning 0 when
// I do this inside `ModalBottomSheet`.
val systemBarsBottomPadding = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()

ModalBottomSheet(
modifier = Modifier.then(modifier),
onDismissRequest = { feedPresenter.dispatch(FeedEvent.BackClicked) },
Expand All @@ -92,9 +97,7 @@ fun FeedInfoBottomSheet(
modifier =
Modifier.fillMaxWidth()
.padding(horizontal = 24.dp)
.padding(
bottom = 16.dp + WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
)
.padding(bottom = 16.dp + systemBarsBottomPadding)
) {
Spacer(Modifier.requiredHeight(8.dp))

Expand Down

0 comments on commit a303a9f

Please sign in to comment.