Compose Modifier

waterfallPadding

Adds padding to accommodate the [waterfall][WindowInsets.

waterfallPaddingSample

fun waterfallPaddingSample() {
    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 shouldn't spill over the edges. They will be green.
                    Box(Modifier.background(Color.Green).waterfallPadding()) {
                        // app content
                    }
                }
            }
        }
    }
}