Google is committed to advancing racial equity for Black communities. See how.

AnimationScope

class AnimationScope<T, V : AnimationVector>
kotlin.Any
   ↳ androidx.compose.animation.core.AnimationScope

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

Summary

Public methods
Unit

Cancels the animation that this AnimationScope corresponds to.

AnimationState<T, V>

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

Properties
Uptime

Boolean

Uptime

Uptime

Start time of the animation.

T

Target value of the animation.

TwoWayConverter<T, V>

TwoWayConverter to convert type T from and to AnimationVector.

T

T

Velocity of type T, converted from velocityVector.

V

Public methods

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.

Properties

finishedTime

var finishedTime: Uptime

isRunning

var isRunning: Boolean

lastFrameTime

var lastFrameTime: Uptime

startTime

val startTime: Uptime

Start time of the animation.

targetValue

val targetValue: T

Target value of the animation.

typeConverter

val typeConverter: TwoWayConverter<T, V>

TwoWayConverter to convert type T from and to AnimationVector.

value

var value: T

velocity

val velocity: T

Velocity of type T, converted from velocityVector.

velocityVector

var velocityVector: V