Property

LocalAmbientModeManager

A androidx.compose.runtime.CompositionLocal that provides the current AmbientModeManager interface.

Source set: Android
public val LocalAmbientModeManager: ProvidableCompositionLocal<AmbientModeManager?> =
    staticCompositionLocalOf {
        null
    }

A androidx.compose.runtime.CompositionLocal that provides the current AmbientModeManager interface.

This local is the primary way for any composable in the hierarchy to access the manager responsible for tracking the ambient (low-power) mode state.

Composables read the manager using LocalAmbientModeManager.current and subscribe to changes via the AmbientModeManager.currentAmbientMode property.

If no AmbientModeManager is explicitly provided higher up the tree (e.g., via rememberAmbientModeManager), this local returns null.

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: