AnimationScope


AnimationScope provides all the animation related info specific to an animation run. An AnimationScope will be accessible during an animation.

See also
animateTo

Summary

Public functions

Unit

Cancels the animation that this AnimationScope corresponds to.

Cmn
AnimationState<T, V>

Creates an AnimationState that populates all the fields in AnimationState from AnimationScope.

Cmn

Public properties

Long

The time when the animation finished successfully in the System.nanoTime timebase.

Cmn
Boolean

Indicates whether the animation is currently running.

Cmn
Long

Last frame time of the animation.

Cmn
Long

Start time of the animation in the System.nanoTime timebase.

Cmn
T

Target value of the animation.

Cmn
TwoWayConverter<T, V>

TwoWayConverter to convert type T from and to AnimationVector.

Cmn
T

Current value of the AnimationScope.

Cmn
T

Velocity of type T, converted from velocityVector.

Cmn
V

Current velocity vector of the AnimationScope.

Cmn

Public functions

cancelAnimation

fun cancelAnimation(): Unit

Cancels the animation that this AnimationScope corresponds to. The scope will not be updated any more after cancelAnimation is called.

toAnimationState

fun toAnimationState(): AnimationState<T, V>

Creates an AnimationState that populates all the fields in AnimationState from AnimationScope.

Public properties

finishedTimeNanos

val finishedTimeNanosLong

The time when the animation finished successfully in the System.nanoTime timebase.

If the animation has never finished (i.e. currently running, interrupted, or never started), this will be AnimationConstants.UnspecifiedTime, unless specified otherwise in AnimationState constructor.

isRunning

val isRunningBoolean

Indicates whether the animation is currently running.

lastFrameTimeNanos

val lastFrameTimeNanosLong

Last frame time of the animation.

If the animation has never started, this will be AnimationConstants.UnspecifiedTime, unless specified otherwise in the AnimationState constructor. lastFrameTimeNanos is the frame time when the animation is last updated, in the System.nanoTime timebase. It is also used for starting a sequential animation in AnimationState.animateTo. This allows the sequential animation to set its start time to when the previous animation is interrupted or finished.

startTimeNanos

val startTimeNanosLong

Start time of the animation in the System.nanoTime timebase.

targetValue

val targetValue: T

Target value of the animation.

typeConverter

val typeConverterTwoWayConverter<T, V>

TwoWayConverter to convert type T from and to AnimationVector.

value

val value: T

Current value of the AnimationScope.

velocity

val velocity: T

Velocity of type T, converted from velocityVector.

velocityVector

val velocityVector: V

Current velocity vector of the AnimationScope.