AnimationScope
-
Cmn
class AnimationScope<T : Any?, V : AnimationVector>
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 |
Cmn
|
AnimationState<T, V> |
Creates an |
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> |
|
Cmn
|
T |
Current value of the |
Cmn
|
T |
Velocity of type |
Cmn
|
V |
Current velocity vector of the |
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 finishedTimeNanos: Long
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.
lastFrameTimeNanos
val lastFrameTimeNanos: Long
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 startTimeNanos: Long
Start time of the animation in the System.nanoTime timebase.
typeConverter
val typeConverter: TwoWayConverter<T, V>
TwoWayConverter to convert type T from and to AnimationVector.