Compose Component

StatusBarSuppression

Suppresses the system status bar for all composables within content.

StatusBarSuppressionContentSample

@Sampled
@Composable
fun StatusBarSuppressionContentSample() {
    // Suppress the status bar for a screen and its children.
    StatusBarSuppression {
        ScreenScaffold {
            Box(
                modifier =
                    Modifier.background(MaterialTheme.colorScheme.background)
                        .padding(CircularProgressIndicatorDefaults.FullScreenPadding)
                        .fillMaxSize()
            ) {
                CircularProgressIndicator(progress = { 0.75f }, startAngle = 120f, endAngle = 60f)
            }
        }
    }
}

StatusBarSuppressionSample

@Sampled
@Composable
fun StatusBarSuppressionSample() {
    // Suppress the status bar to avoid overlapping with the full-screen circular progress
    // indicator.
    StatusBarSuppression()

    Box(
        modifier =
            Modifier.background(MaterialTheme.colorScheme.background)
                .padding(CircularProgressIndicatorDefaults.FullScreenPadding)
                .fillMaxSize()
    ) {
        CircularProgressIndicator(progress = { 0.75f }, startAngle = 120f, endAngle = 60f)
    }
}

Content updated: