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

DurationBasedAnimationSpec

interface DurationBasedAnimationSpec<V : AnimationVector> : AnimationSpec<V>
androidx.animation.DurationBasedAnimationSpec

Base class for AnimationSpecs that are based on a fixed duration.

Summary

Public methods
open Long
getDurationMillis(start: V, end: V, startVelocity: V)

Calculates the duration of an animation.

Inherited functions
Inherited extension functions
From androidx.animation
TargetBasedAnimation<V, V>
AnimationSpec<V>.createAnimation(startValue: V, endValue: V, startVelocity: V)

Creates a TargetBasedAnimation from a given AnimationSpec of AnimationVector type.

TargetBasedAnimation<T, V>
AnimationSpec<V>.createAnimation(startValue: T, endValue: T, startVelocityVector: V, converter: TwoWayConverter<T, V>)

Creates a TargetBasedAnimation from a given AnimationSpec of AnimationVector type.

Properties
abstract Long

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

abstract Long

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

Public methods

getDurationMillis

open fun getDurationMillis(
    start: V,
    end: V,
    startVelocity: 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 start, end values, and startVelocity.

Parameters
start: V start value of the animation
end: V end value of the animation
startVelocity: V start velocity of the animation

Properties

delay

abstract val delay: Long

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

duration

abstract val duration: Long

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