Compose Modifier

mandatorySystemGesturesPadding

Adds padding to accommodate the [mandatory system gestures][WindowInsets.

mandatorySystemGesturesPaddingSample

fun mandatorySystemGesturesPaddingSample() {
    class SampleActivity : ComponentActivity() {
        override fun onCreate(savedInstanceState: Bundle?) {
            WindowCompat.setDecorFitsSystemWindows(window, false)
            super.onCreate(savedInstanceState)
            setContent {
                Box(Modifier.background(Color.Blue).systemBarsPadding()) {
                    // The app content won't interfere with the mandatory system gestures area.
                    // It will just be white.
                    Box(Modifier.background(Color.White).mandatorySystemGesturesPadding()) {
                        // app content
                    }
                }
            }
        }
    }
}