suppressStatusBar
@Stable public fun Modifier.suppressStatusBar(): Modifier
Suppresses the status bar and collapses top status bar inset padding to 0.dp.
In cases where the system status bar overlay is not yet supported by the platform, the fallback TimeText will also be suppressed for consistency. Outside of a scaffold (such as in a standalone dialog or overlay window), hides the status bar directly on the current window and restores the initial visibility state when leaving composition or becoming inactive.
For design guidance and best practices on status bar suppression and immersive experiences on Wear OS, see the Status Bar guide.
Layout-Phase Usage: When using ScreenScaffold, pass contentPadding directly to containers like TransformingLazyColumn as content padding or to layout modifiers (such as Modifier.padding(contentPadding)) rather than inspecting contentPadding.calculateTopPadding() directly during the composition phase. Inspecting padding values during composition before the first layout pass can observe initial unsuppressed insets before suppression nodes are fully attached, whereas layout modifiers evaluate insets during measure/layout where suppression state is fully resolved:
// Recommended (evaluated in layout phase after child nodes attach):
ScreenScaffold { contentPadding ->
Box(modifier = Modifier.fillMaxSize().padding(contentPadding)) {
DatePicker() // Suppresses status bar internally
}
}
// Avoid (eager composition read before child nodes attach):
ScreenScaffold { contentPadding ->
val topPadding = contentPadding.calculateTopPadding()
DatePicker() // Suppresses status bar internally
}
Example of status bar suppression for an individual component or overlay within a screen (such as a picker or media player):
Example of status bar suppression if only a specific screen in your app should be full-screen / immersive:
Example of status bar suppression if the entire application (or Activity) is an immersive full-screen experience across all screens - this is not recommended for most apps because users will lose access to the time and important status indicators on every screen: