Android 12 Developer Preview is here! Try it out, and give us your feedback!

VectorizedDurationBasedAnimationSpec

interface VectorizedDurationBasedAnimationSpec<V : AnimationVector> : VectorizedFiniteAnimationSpec<V>
androidx.compose.animation.core.VectorizedDurationBasedAnimationSpec

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

Summary

Public methods
open Long
getDurationNanos(initialValue: V, targetValue: V, initialVelocity: V)

Calculates the duration of an animation.

Inherited functions
Properties
abstract Int

delay defines the amount of time that animation can be delayed.

abstract Int

duration is the amount of time while animation is not yet finished.

Inherited properties

Public methods

getDurationNanos

open fun getDurationNanos(
    initialValue: V,
    targetValue: V,
    initialVelocity: V
): Long

Calculates the duration of an animation. For duration-based animations, this will return the pre-defined duration. For physics-based animations, the duration will be estimated based on the physics configuration (such as spring stiffness, damping ratio, visibility threshold) as well as the initialValue, targetValue values, and