Skip to content

Instantly share code, notes, and snippets.

@CostaFot
Last active March 13, 2024 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CostaFot/0ddfe41824ff9c01831c882f8b469516 to your computer and use it in GitHub Desktop.
Save CostaFot/0ddfe41824ff9c01831c882f8b469516 to your computer and use it in GitHub Desktop.
@Composable
fun MainContent() {
Scaffold { paddingValues ->
// ....
val layoutDirection = LocalLayoutDirection.current
Box(
modifier = Modifier
.fillMaxSize()
.padding(
start = paddingValues.calculateStartPadding(layoutDirection),
end = paddingValues.calculateEndPadding(layoutDirection),
bottom = paddingValues.calculateBottomPadding(),
)
) {
Column(
modifier = Modifier.fillMaxSize()
) {
Spacer(
modifier = Modifier
.windowInsetsTopHeight(WindowInsets.statusBars)
.fillMaxWidth()
.background(Color.Red)
)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment