Compose Unstyled 2.0 is out! Check the official announcement blog ->
Interface

AnimateStyleScope

An interface that introduces animate functions to a Style receiver scope.

Source set: Common
@ExperimentalFoundationStyleApi
interface AnimateStyleScope

An interface that introduces animate functions to a Style receiver scope.

Functions

animate

fun animate(toSpec: AnimationSpec<Float>, fromSpec: AnimationSpec<Float>, block: () -> Unit)

Specifies a Style whose properties will be animated to when they change, using the provided AnimationSpec. This allows for smooth transitions between style states with custom animation curves.

Parameters

toSpec The AnimationSpec to use for the animation to the values set in block. This animation is used when the animate call is added to the style.
fromSpec The AnimationSpec to use for the animation from the values set in block. This animation is used when the animate call is removed from the style.
block The block containing the properties values to animate

Last updated: