ThemeAnimationState

constructor(themeProvider: ThemeProvider, coroutineScope: CoroutineScope, animationSpec: AnimationSpec<Float>, format: ThemeAnimationFormat, useDynamicContent: Boolean)

Parameters

themeProvider

A ThemeProvider instance that provides the current theme and allows for theme updates. Typically, a data access object that saves the theme to a local or remote storage.

coroutineScope

The coroutine scope used for launching asynchronous operations, such as record request coordination.

animationSpec

The animation specification for theme transitions.

format

The format/style of the theme animation. See ThemeAnimationFormat for available styles.

useDynamicContent

Whether to capture and animate dynamic content during theme transitions. If set to true, the target content (that is, the theme

  • to which the theme is toggled) will be drawn dynamically and any changes to it, including scrolling,

  • animations etc. will be preserved. Note that the abandoned theme will still be drawn statically, which may lead to inconsistency

  • between the target and abandoned parts of the animation. Defaults to false.