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

androidx.compose.animation.core

Interfaces

Animation

This interface provides a convenient way to query from an VectorizedAnimationSpec or FloatDecayAnimationSpec: It spares the need to pass the starting conditions and in some cases ending condition for each value or velocity query, and instead only requires the play time to be passed for such queries.

AnimationClockObservable

This interface allows AnimationClock to be subscribed and unsubscribed.

AnimationClockObserver

Observer for animation clock changes.

AnimationSpec

AnimationSpec stores the specification of an animation, including 1) the data type to be animated, and 2) the animation configuration (i.

DecayAnimationSpec

DecayAnimationSpec stores the specification of an animation, including 1) the data type to be animated, and 2) the animation configuration (i.

DurationBasedAnimationSpec

This describes AnimationSpecs that are based on a fixed duration, such as KeyframesSpec, TweenSpec, and SnapSpec.

FiniteAnimationSpec

FiniteAnimationSpec is the interface that all non-infinite AnimationSpecs implement, including: TweenSpec, SpringSpec, KeyframesSpec, RepeatableSpec, SnapSpec, etc.

FloatAnimationSpec

FloatAnimationSpec interface is similar to VectorizedAnimationSpec, except it deals exclusively with floats.

FloatDecayAnimationSpec

This animation interface is intended to be stateless, just like Animation.

MutableTransitionState

MutableTransitionState is used in TransitionDefinition for constructing various TransitionStates with corresponding properties and their values.

PropKey

Property key of T type.

TransitionState

TransitionState holds a number of property values.

TwoWayConverter

TwoWayConverter class contains the definition on how to convert from an arbitrary type T to a AnimationVector, and convert the AnimationVector back to the type T.

VectorizedAnimationSpec

VectorizedAnimationSpecs are stateless vector based animation specifications.

VectorizedDecayAnimationSpec

VectorizedDecayAnimationSpecs are stateless vector based decay animation specifications.

VectorizedDurationBasedAnimationSpec

Base class for VectorizedAnimationSpecs that are based on a fixed durationMillis.

VectorizedFiniteAnimationSpec

All the finite VectorizedAnimationSpecs implement this interface, including: VectorizedKeyframesSpec, VectorizedTweenSpec, VectorizedRepeatableSpec, VectorizedSnapSpec, VectorizedSpringSpec, etc.

Classes

Animatable

Animatable is a value holder that automatically animates its value when the value is changed via animateTo.

AnimatedFloat

This class inherits most of the functionality from BaseAnimatedValue.

AnimatedValue

AnimatedValue is an animatable value holder.

AnimationResult

AnimationResult contains information about an animation at the end of the animation.

AnimationScope

AnimationScope provides all the animation related info specific to an animation run.

AnimationState

AnimationState contains the necessary information to indicate the state of an animation.

AnimationVector

AnimationVector class that is the base class of AnimationVector1D, AnimationVector2D, AnimationVector3D and AnimationVector4D.

AnimationVector1D

This class defines a 1D vector.

AnimationVector2D

This class defines a 2D vector that contains two Float values for the two dimensions.

AnimationVector3D

This class defines a 3D vector that contains three Float value fields for the three dimensions.

AnimationVector4D

This class defines a 4D vector that contains four Float fields for its four dimensions.

BaseAnimatedValue

This is the base class for AnimatedValue.

BaseAnimationClock

Base implementation for the AnimationClockObservable that handles the subscribing and unsubscribing logic that would be common for all custom animation clocks.

CubicBezierEasing

A cubic polynomial easing.

DecayAnimation

DecayAnimation is an animation that slows down from initialVelocityVector as time goes on.

DefaultAnimationClock

Default Choreographer based clock that pushes a new frame to all subscribers on each Choreographer tick, until all subscribers have unsubscribed.

FloatExponentialDecaySpec

This is a decay animation where the friction/deceleration is always proportional to the velocity.

FloatPropKey

Built-in property key for Float properties.

FloatSpringSpec

FloatSpringSpec animation uses a spring animation to animate a Float value.

FloatTweenSpec

FloatTweenSpec animates a Float value from any start value to any end value using a provided easing function.

InfiniteRepeatableSpec

InfiniteRepeatableSpec repeats the provided animation infinite amount of times.

IntPropKey

Built-in property key for Int properties.

KeyframesSpec

KeyframesSpec creates a VectorizedKeyframesSpec animation.

ManualAnimationClock

A custom clock whose frame time can be manually updated via mutating clockTimeMillis.

ManualFrameClock

A MonotonicFrameClock built on a BroadcastFrameClock that keeps track of the current time.

MonotonicFrameAnimationClock

A MonotonicFrameAnimationClock is an AnimationClockObservable that is built on top of the MonotonicFrameClock found in the given scope.

RepeatableSpec

RepeatableSpec takes another DurationBasedAnimationSpec and plays it iterations times.

SnapSpec

SnapSpec describes a jump-cut type of animation.

SpringSpec

Creates a SpringSpec that uses the given spring constants (i.

TargetAnimation

TargetAnimation class defines how to animate to a given target value.

TargetBasedAnimation

This is a convenient animation wrapper class that works for all target based animations, i.

Transition

Transition manages all the child animations on a state level.

TransitionAnimation

TransitionAnimation is the underlying animation used in androidx.compose.animation.transition for animating from one set of property values (i.

TransitionDefinition

TransitionDefinition contains all the animation related configurations that will be used in a state-based transition.

TransitionSpec

Static specification for the transition from one state to another.

TweenSpec

Creates a TweenSpec configured with the given duration, delay, and easing curve.

VectorizedFloatAnimationSpec

A convenient implementation of VectorizedFloatAnimationSpec that turns a FloatAnimationSpec into a multi-dimensional VectorizedFloatAnimationSpec, by using the same FloatAnimationSpec on each dimension of the AnimationVector that is being animated.

VectorizedInfiniteRepeatableSpec

This animation takes another VectorizedDurationBasedAnimationSpec and plays it infinite times.

VectorizedKeyframesSpec

VectorizedKeyframesSpec class manages the animation based on the values defined at different timestamps in the duration of the animation (i.

VectorizedRepeatableSpec

This animation takes another VectorizedDurationBasedAnimationSpec and plays it iterations times.

VectorizedSnapSpec

VectorizedSnapSpec immediately snaps the animating value to the end value.

VectorizedSpringSpec

VectorizedSpringSpec uses spring animations to animate (each dimension of) AnimationVectors.

VectorizedTweenSpec

VectorizedTweenSpec animates a AnimationVector value by interpolating the start and end value, in the given durationMillis using the given easing curve.

Type-aliases

Easing

Easing is a way to adjust an animation’s fraction.

ExponentialDecay

OnAnimationEnd

Typealias for lambda that will be invoked when fling animation ends.

Annotations

InternalAnimationApi

Enums

AnimationEndReason

Possible reasons with which DynamicTargetAnimation can finish

InterruptionHandling

RepeatMode

Repeat mode for RepeatableSpec and VectorizedRepeatableSpec.

Top-level functions summary

Animatable<Float, AnimationVector1D>
Animatable(initialValue: Float, visibilityThreshold: Float = Spring.DefaultDisplacementThreshold)

This Animatable function creates a float value holder that automatically animates its value when the value is changed via animateTo.

AnimatedFloat
AnimatedFloat(initVal: Float, clock: AnimationClockObservable, visibilityThreshold: Float = Spring.DefaultDisplacementThreshold)

Factory method for creating an AnimatedFloat object, and initialize the value field to initVal.

AnimatedValue<T, V>
AnimatedValue(initVal: T, typeConverter: TwoWayConverter<T, V>, clock: AnimationClockObservable, visibilityThreshold: T? = null)

Factory method for creating an AnimatedValue object, and initialize the value field to initVal.

AnimatedValue<V, V>
AnimatedVector(initVal: V, clock: AnimationClockObservable, visibilityThreshold: V = initVal.newInstanceOfValue(Spring.DefaultDisplacementThreshold))

Factory method for creating an AnimatedVector object, and initialize the value field to initVal.