Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

androidx.compose.animation.core

Interfaces

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.

DurationBasedAnimationSpec

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

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.

VectorizedDurationBasedAnimationSpec

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

Classes

AnimatedFloat

This class inherits most of the functionality from BaseAnimatedValue.

AnimatedValue

AnimatedValue is an animatable value holder.

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

Fixed Decay animation wraps around a FloatDecayAnimationSpec and assumes its starting value and velocity never change throughout the animation.

DefaultAnimationClock

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

ExponentialDecay

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.

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.

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.

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.

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

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.

AnimationVector1D

Factory method to create an AnimationVector1D

AnimationVector2D

Factory method to create an AnimationVector2D

AnimationVector3D
AnimationVector(v1: Float, v2: Float, v3: Float)

Factory method to create an AnimationVector3D

AnimationVector4D
AnimationVector(v1: Float, v2: Float, v3: Float, v4: Float)

Factory method to create an AnimationVector4D

TargetBasedAnimation<T, V>
TargetBasedAnimation(animationSpec: AnimationSpec<T>, startValue: T, endValue: T, startVelocity: T, converter: TwoWayConverter<T, V>)

Creates a TargetBasedAnimation with the given start/end conditions of the animation, and the provided animationSpec.

TwoWayConverter<T, V>
TwoWayConverter(convertToVector: (T) -> V, convertFromVector: (V) -> T)

Factory method to create a TwoWayConverter that converts a type T from and to an AnimationVector type.

KeyframesSpec<T>

Creates a KeyframesSpec animation, initialized with init.

AnimationSpec<T>
repeatable(iterations: Int, animation: DurationBasedAnimationSpec<T>, repeatMode: RepeatMode = RepeatMode.Restart)

Creates a RepeatableSpec that plays a DurationBasedAnimationSpec (e.

AnimationSpec<T>
snap(delayMillis: Int = 0)

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

SpringSpec<T>
spring(dampingRatio: Float = Spring.DampingRatioNoBouncy, stiffness: Float = Spring.StiffnessMedium, visibilityThreshold: T? = null)

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

TransitionDefinition<T>

Creates a TransitionDefinition using the init function to initialize it.

TweenSpec<T>
tween(durationMillis: Int = DefaultDurationMillis, delayMillis: Int = 0, easing: Easing = FastOutSlowInEasing)

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

Top-level properties summary

CubicBezierEasing

Elements exiting a screen use acceleration easing, where they start at rest and end at peak velocity.

CubicBezierEasing

Elements that begin and end at rest use this standard easing.

TwoWayConverter<Float, AnimationVector1D>

A TwoWayConverter that converts Float from and to AnimationVector1D

TwoWayConverter<Int, AnimationVector1D>

A TwoWayConverter that converts Int from and to AnimationVector1D

Easing

It returns fraction unmodified.

CubicBezierEasing

Incoming elements are animated using deceleration easing, which starts a transition at peak velocity (the fastest point of an element’s movement) and ends at rest.

Extension functions summary

For ManualFrameClock
Unit

Advances the clock by the given number of milliseconds.

For TransitionDefinition
TransitionAnimation<T>

Creates a transition animation using the transition definition and the given clock.

For AnimatedFloat
Unit
AnimatedFloat.fling(startVelocity: Float, decay: FloatDecayAnimationSpec = ExponentialDecay(), onEnd: OnAnimationEnd? = null)

Starts a fling animation with the specified starting velocity.

Unit
AnimatedFloat.fling(startVelocity: Float, decay: FloatDecayAnimationSpec = ExponentialDecay(), adjustTarget: (Float) -> TargetAnimation?, onEnd: OnAnimationEnd? = null)

Starts a fling animation with the specified starting velocity.

Top-level functions

AnimatedFloat

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

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

Parameters
initVal: Float Initial value to initialize the animation to.
clock: AnimationClockObservable The animation clock used to drive the animation.
visibilityThreshold: Float = Spring.DefaultDisplacementThreshold Threshold at which the animation may round off to its target value.

AnimatedValue

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

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

Parameters
initVal: T Initial value to initialize the animation to.
typeConverter: TwoWayConverter<T, V> Converter for converting value type T to AnimationVector, and vice versa
clock: AnimationClockObservable The animation clock used to drive the animation.
visibilityThreshold: T? = null Threshold at which the animation may round off to its target value.

AnimatedVector

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

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

Parameters
initVal: V Initial value to initialize the animation to.
clock: AnimationClockObservable The animation clock used to drive the animation.
visibilityThreshold: V = initVal.newInstanceOfValue(Spring.DefaultDisplacementThreshold) Threshold at which the animation may round off to its target value.

AnimationVector

fun AnimationVector(v1: Float): AnimationVector1D

Factory method to create an AnimationVector1D

Parameters
v1: Float value to set on the value field of AnimationVector1D

AnimationVector

fun AnimationVector(
    v1: Float,
    v2: Float
): AnimationVector2D

Factory method to create an AnimationVector2D

Parameters
v1: Float value to set on the first dimension