TransitionAnimation

class TransitionAnimation<T> : TransitionState
kotlin.Any
   ↳ androidx.animation.TransitionAnimation

TransitionAnimation is responsible for animating from one set of property values (i.e. one TransitionState) to another. More specifically, it reads the property values out of the new state that it is going to, as well as the animations defined for the properties, and run these animations until all properties have reached their pre-defined values in the new state. When no animation is specified for a property, a default SpringAnimation animation will be used.

TransitionAnimation may be interrupted while the animation is on-going by a request to go to another state. TransitionAnimation ensures that all the animating properties preserve their current value and velocity as they createAnimation to the new state.

Once a TransitionDefinition is instantiated, a TransitionAnimation can be created via TransitionDefinition.createAnimation.

Summary

Public constructors

<init>(def: TransitionDefinition<T>, clock: AnimationClockObservable, initState: T? = null)

TransitionAnimation is responsible for animating from one set of property values (i.

Public methods

operator T
get(propKey: PropKey<T>)

Gets the value of a property with a given property key.

Unit
toState(name: T)

Starts the animation to go to a new state with the given state name.

Properties

Boolean

(T) -> Unit

() -> Unit

Public constructors

<init>

TransitionAnimation(
    def: TransitionDefinition<T>,
    clock: AnimationClockObservable,
    initState: T? = null)

TransitionAnimation is responsible for animating from one set of property values (i.e. one TransitionState) to another. More specifically, it reads the property values out of the new state that it is going to, as well as the animations defined for the properties, and run these animations until all properties have reached their pre-defined values in the new state. When no animation is specified for a property, a default SpringAnimation animation will be used.

TransitionAnimation may be interrupted while the animation is on-going by a request to go to another state. TransitionAnimation ensures that all the animating properties preserve their current value and velocity as they createAnimation to the new state.

Once a TransitionDefinition is instantiated, a TransitionAnimation can be created via TransitionDefinition.createAnimation.

Public methods

get

operator fun <T> get(propKey: PropKey<T>): T

Gets the value of a property with a given property key.

Parameters
propKey: PropKey<T> Property key (defined in TransitionDefinition) for a specific property

toState

fun toState(name: T): Unit

Starts the animation to go to a new state with the given state name.

Parameters
name: T Name of the TransitionState that is defined in the TransitionDefinition.

Properties

isRunning

var isRunning: Boolean

onStateChangeFinished

var onStateChangeFinished: (T) -> Unit

onUpdate

var onUpdate: () -> Unit