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

SeekableAnimation

class SeekableAnimation<T>
kotlin.Any
   ↳ androidx.animation.SeekableAnimation

Seekable animation class provides utilities to create an animation using a state pair, and supports querying animation values based on a specific time. This class is designed to be entirely stateless in terms of animation lifecycle. This design makes it easy for higher level stateful construct to be built on top of it.

This API is intended for tools' use only. Hence the @RestrictTo.

Summary

Public constructors

<init>(def: TransitionDefinition<T>, fromState: T, toState: T)

Seekable animation class provides utilities to create an animation using a state pair, and supports querying animation values based on a specific time.

Public methods

Map<PropKey<Any, AnimationVector>, Any>
getAnimValuesAt(playTime: Long)

Returns the animation values at the given playtime.

Properties

TransitionDefinition<T>

Long

Duration of the animation.

Public constructors

<init>

SeekableAnimation(
    def: TransitionDefinition<T>,
    fromState: T,
    toState: T)

Seekable animation class provides utilities to create an animation using a state pair, and supports querying animation values based on a specific time. This class is designed to be entirely stateless in terms of animation lifecycle. This design makes it easy for higher level stateful construct to be built on top of it.

This API is intended for tools' use only. Hence the @RestrictTo.

Public methods

getAnimValuesAt

fun getAnimValuesAt(playTime: Long): Map<PropKey<Any, AnimationVector>, Any>

Returns the animation values at the given playtime. This time could be any time between 0 and duration, where 0 means the beginning of the animation.

Parameters
playTime: Long animation play time in 0,duration

Properties

def

val def: TransitionDefinition<T>

duration

val duration: Long

Duration of the animation. When there are multiple properties being animated in a transition, this will be the duration of the longest running animation.