TransitionSpec

class TransitionSpec<S>
kotlin.Any
   ↳ androidx.animation.TransitionSpec

Static specification for the transition from one state to another.

Each property involved in the states that the transition is from and to can have an animation associated with it. When such an animation is defined, the animation system will be using it instead of the default SpringAnimation animation to createAnimation the value change for that property.


//Unresolved: androidx.animation.samples.TransitionSpecWith3Properties

Summary

Public methods

DurationBasedAnimationBuilder<T>
keyframes(init: KeyframesBuilder<T>.() -> Unit)

Creates a Keyframes animation, initialized with init

AnimationBuilder<T>
physics(init: PhysicsBuilder<T>.() -> Unit)

Creates a SpringAnimation animation, initialized with init

AnimationBuilder<T>
repeatable(init: RepeatableBuilder<T>.() -> Unit)

Creates a Repeatable animation, initialized with init

AnimationBuilder<T>

Creates a Snap animation for immediately switching the animating value to the end value.

DurationBasedAnimationBuilder<T>
tween(init: TweenBuilder<T>.() -> Unit)

Creates a Tween animation, initialized with init

infix Unit
PropKey<T>.using(builder: AnimationBuilder<T>)

Associates a property with a AnimationBuilder

Properties

InterruptionHandling

The interruption handling mechanism.

S?

Optional state where should we start switching after this transition finishing.

Public methods

keyframes

fun <T> keyframes(init: KeyframesBuilder<T>.() -> Unit): DurationBasedAnimationBuilder<T>

Creates a Keyframes animation, initialized with init

Parameters
init: KeyframesBuilder<T>.() -> Unit Initialization function for the Keyframes animation

physics

fun <T> physics(init: PhysicsBuilder<T>.() -> Unit): AnimationBuilder<T>

Creates a SpringAnimation animation, initialized with init

Parameters
init: PhysicsBuilder<T>.() -> Unit Initialization function for the SpringAnimation animation

repeatable

fun <T> repeatable(init: RepeatableBuilder<T>.() -> Unit): AnimationBuilder<T>

Creates a Repeatable animation, initialized with init

Parameters
init: RepeatableBuilder<T>.() -> Unit Initialization function for the Repeatable animation

snap

fun <T> snap(): AnimationBuilder<T>

Creates a Snap animation for immediately switching the animating value to the end value.

tween

fun <T> tween(init: TweenBuilder<T>.() -> Unit): DurationBasedAnimationBuilder<T>

Creates a Tween animation, initialized with init

Parameters
init: TweenBuilder<T>.() -> Unit Initialization function for the Tween animation

using

infix fun <T> PropKey<T>.using(builder: AnimationBuilder<T>): Unit

Associates a property with a AnimationBuilder

Parameters
builder: AnimationBuilder<T> : AnimationBuilder for animating this property value changes

Properties

interruptionHandling

var interruptionHandling: InterruptionHandling

The interruption handling mechanism. The default interruption handling is InterruptionHandling.PHYSICS. Meaning both value and velocity of the property will be preserved as the target state (and therefore target animation value) changes. InterruptionHandling.TWEEN, which only ensures the continuity of current animation value. InterruptionHandling.UNINTERRUPTIBLE defines a scenario where an animation is so important that it cannot be interrupted, so the new state request has to be queued. InterruptionHandling.SNAP_TO_END can be used for cases where higher priority events (such as user gesture) come in and the on-going animation needs to finish immediately to give way to the user events.

nextState

var nextState: S?

Optional state where should we start switching after this transition finishing.