Adds padding to accommodate the [safe gestures][WindowInsets.
safeGesturesPaddingSample
fun safeGesturesPaddingSample() {
class SampleActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
WindowCompat.setDecorFitsSystemWindows(window, false)
super.onCreate(savedInstanceState)
setContent {
Box(Modifier.background(Color.Black).systemBarsPadding()) {
// The app content will only be drawn where there is no possible
// gesture confusion. The rest will be plain white
Box(Modifier.background(Color.White).safeGesturesPadding()) {
// app content
}
}
}
}
}
}