Known direct subclasses
StyleScope

A StyleScope is the receiver scope of a Style lambda.


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

See also
StyleScope

Summary

Public functions

Unit
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.

Cmn

Extension functions

Unit

Specifies a Style whose properties will be animated to when they change.

Cmn
Unit

Specifies a Style whose properties will be animated to when they change, using the provided AnimationSpec.

Cmn

Public functions

animate

fun animate(
    toSpec: AnimationSpec<Float>,
    fromSpec: AnimationSpec<Float>,
    block: () -> Unit
): 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: AnimationSpec<Float>

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: AnimationSpec<Float>

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: () -> Unit

The block containing the properties values to animate

See also
Style
AnimationSpec

Extension functions

AnimateStyleScope.animate

@ExperimentalFoundationStyleApi
fun AnimateStyleScope.animate(block: () -> Unit): Unit

Specifies a Style whose properties will be animated to when they change. This uses a default animation specification. This allows for smooth transitions between style states without manual animation setup. A androidx.compose.animation.core.spring will be used for the animation for both animating to and from the style.

Parameters
block: () -> Unit

The target Style whose properties should be animated.

See also
Style

AnimateStyleScope.animate

@ExperimentalFoundationStyleApi
fun AnimateStyleScope.animate(spec: AnimationSpec<Float>, block: () -> Unit): 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. The same animation spec will be used for animating both to and from the style.

Parameters
spec: AnimationSpec<Float>

The AnimationSpec to use for the animation.

block: () -> Unit

The target Style whose properties should be animated.

See also
Style
AnimationSpec