Class

StyleAnimations.Entry

There is a single Entry per animate block in a Style lambda.

Common
inner class Entry(
        val key: Int,
        var style: Style,
        var toSpec: AnimationSpec<Float>,
        var fromSpec: AnimationSpec<Float>,
    )

There is a single Entry per animate block in a Style lambda. This entry is created when the block becomes active, and then is disposed when the block becomes inactive and the "exit" animation is complete.

Properties

Common
val anim = Animatable(0f)
Common
val styleScope = ResolvedStyle()
Common
var state: Int

This is the current "state" of this entry. These states are used to understand what needs to be done before/after/during resolving a style. We have the following states:

  • Untouched. This means that during the resolve step, this animation did NOT get recorded. This is an indication that the corresponding Style is no longer active, which means that we need to transition into the "Removing" state and call "animateOut". - Unchanged. This means that during the resolve step, this animation was "recorded", but nothing has changed. So if we were animating, keep animating. If we were done animating, then do nothing. - Inserted. This style was added during the most recent resolve. This means that we have yet to call the "animateIn" API to start this animation. - Removing. The style is "animating out". So the style is no longer active but we need to keep it in the list so that we see the exit animation.
Common
var job: Job?

Functions

animateIn

fun animateIn(coroutineScope: CoroutineScope)

snapIn

fun snapIn(coroutineScope: CoroutineScope)

animateOut

fun animateOut(coroutineScope: CoroutineScope)

snapOut

fun snapOut(coroutineScope: CoroutineScope)