Property

LocalTimeSource

CompositionLocal providing the TimeSource for TimeText.

Source set: Android
public val LocalTimeSource: ProvidableCompositionLocal<TimeSource> = staticCompositionLocalOf {
    DefaultTimeSource()
}

CompositionLocal providing the TimeSource for TimeText.

This provides the mechanism to override the time source for composables that may display TimeText without providing a slot for an explicit timeSource parameter, such as the fallback TimeText provided by AppScaffold or ScreenScaffold for platform builds that do not support the system status bar.

Example of providing a fixed time for testing:

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: