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

TweenSpec

public final class TweenSpec<T extends Object> implements DurationBasedAnimationSpec


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

Summary

Public constructors

<T extends Object> TweenSpec(int durationMillis, int delay, @NonNull Easing easing)

Public methods

boolean
equals(Object other)
final int

the number of milliseconds the animation waits before starting, 0 by default.

final int

duration of the VectorizedTweenSpec animation.

final @NonNull Easing

the easing curve used by the animation.

int
@NonNull VectorizedTweenSpec<@NonNull V>
<V extends AnimationVector> vectorize(
    @NonNull TwoWayConverter<@NonNull T, @NonNull V> converter
)

Creates a VectorizedAnimationSpec with the given TwoWayConverter.

Public constructors

TweenSpec

public <T extends Object> TweenSpec(int durationMillis, int delay, @NonNull Easing easing)
Parameters
int durationMillis

duration of the VectorizedTweenSpec animation.

int delay

the number of milliseconds the animation waits before starting, 0 by default.

@NonNull Easing easing

the easing curve used by the animation. FastOutSlowInEasing by default.

Public methods

equals

public boolean equals(Object other)

getDelay

public final int getDelay()

the number of milliseconds the animation waits before starting, 0 by default.

getDurationMillis

public final int getDurationMillis()

duration of the VectorizedTweenSpec animation.

getEasing

public final @NonNull Easing getEasing()

the easing curve used by the animation. FastOutSlowInEasing by default.

hashCode

public int hashCode()

vectorize

public @NonNull VectorizedTweenSpec<@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