Adds padding to accommodate the [safe drawing][WindowInsets.
safeDrawingPaddingSample
fun safeDrawingPaddingSample() {
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 won't have anything drawing over it, but all the
// background not in the status bars will be white.
Box(Modifier.background(Color.White).safeDrawingPadding()) {
// app content
}
}
}
}
}
}