{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

FiniteAnimationSpec

public interface FiniteAnimationSpec<T extends Object> extends AnimationSpec

Known direct subclasses
DurationBasedAnimationSpec

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

RepeatableSpec

RepeatableSpec takes another DurationBasedAnimationSpec and plays it iterations times.

SpringSpec

Creates a SpringSpec that uses the given spring constants (i.e. dampingRatio and stiffness.

Known indirect subclasses
KeyframesSpec

KeyframesSpec creates a VectorizedKeyframesSpec animation.

SnapSpec

SnapSpec describes a jump-cut type of animation.

TweenSpec

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


FiniteAnimationSpec is the interface that all non-infinite AnimationSpecs implement, including: TweenSpec, SpringSpec, KeyframesSpec, RepeatableSpec, SnapSpec, etc. By definition, InfiniteRepeatableSpec does not implement this interface.

See also
InfiniteRepeatableSpec

Summary

Public methods

abstract @NonNull VectorizedFiniteAnimationSpec<@NonNull V>
<V extends AnimationVector> vectorize(
    @NonNull TwoWayConverter<@NonNull T, @NonNull V> converter
)

Creates a VectorizedAnimationSpec with the given TwoWayConverter.

Public methods

vectorize

abstract @NonNull VectorizedFiniteAnimationSpec<@NonNull V> <V extends AnimationVector> vectorize(
    @NonNull TwoWayConverter<@NonNull T, @NonNull V> converter
)

Creates a VectorizedAnimationSpec with the given TwoWayConverter.

The underlying animation system operates on AnimationVectors. T will be converted to AnimationVector to animate. VectorizedAnimationSpec describes how the converted AnimationVector should be animated. E.g. The animation could simply interpolate between the start and end values (i.e.TweenSpec), or apply spring physics to produce the motion (i.e. SpringSpec), etc)

Parameters
@NonNull TwoWayConverter<@NonNull T, @NonNull V> converter

converts the type T from and to AnimationVector type