Compose Modifier

waterfallPadding

Adds padding to accommodate the waterfall insets.

waterfallPaddingSample

@Sampled
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
                    }
                }
            }
        }
    }
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: