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


interface VectorizedDurationBasedAnimationSpec<V : AnimationVector> : VectorizedFiniteAnimationSpec<V>

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


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

Calculates the duration of an animation.

Inherited functions
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


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