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

TweenSpec

@Immutable class TweenSpec<T> : DurationBasedAnimationSpec<T>
kotlin.Any
   ↳ androidx.compose.animation.core.TweenSpec

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

Summary

Public constructors
<init>(durationMillis: Int = DefaultDurationMillis, delay: Int = 0, easing: Easing = FastOutSlowInEasing)

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

Public methods
VectorizedTweenSpec<V>
vectorize(converter: TwoWayConverter<T, V>)

Creates a VectorizedAnimationSpec with the given TwoWayConverter.

Properties
Int

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

Int

duration of the VectorizedTweenSpec animation.

Easing

the easing curve used by the animation.

Public constructors

<init>

TweenSpec(
    durationMillis: Int = DefaultDurationMillis,
    delay: Int = 0,
    easing: Easing = FastOutSlowInEasing)

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

Parameters
durationMillis: Int = DefaultDurationMillis duration of the VectorizedTweenSpec animation.
delay: Int = 0 the number of milliseconds the animation waits before starting, 0 by default.
easing: Easing = FastOutSlowInEasing the easing curve used by the animation. FastOutSlowInEasing by default.

Public methods

vectorize

fun <V : AnimationVector> vectorize(converter: TwoWayConverter<T, V>): VectorizedTweenSpec<V>

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
converter: TwoWayConverter<T, V> converts the type T from and to AnimationVector type

Properties

delay

val delay: Int

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

durationMillis

val durationMillis: Int

duration of the VectorizedTweenSpec animation.

easing

val easing: Easing

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