# VectorizedDurationBasedAnimationSpec

Artifact: [androidx.compose.animation:animation-core](https://developer.android.com/jetpack/androidx/releases/compose-animation) [View Source](https://cs.android.com/search?q=file:androidx/compose/animation/core/VectorizedAnimationSpec.kt+class:androidx.compose.animation.core.VectorizedDurationBasedAnimationSpec) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.0.0) Common/All
- Cmn

  ```
  interface VectorizedDurationBasedAnimationSpec<V : AnimationVector> : VectorizedFiniteAnimationSpec<V>
  ```
Known direct subclasses [VectorizedKeyframesSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedKeyframesSpec), [VectorizedSnapSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedSnapSpec), [VectorizedTweenSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedTweenSpec)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedKeyframesSpec` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedKeyframesSpec` class manages the animation based on the values defined at different timestamps in the duration of the animation (i.e. different keyframes). |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedSnapSpec` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedSnapSpec` immediately snaps the animating value to the end value. |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedTweenSpec` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedTweenSpec` animates a `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector` value by interpolating the start and end value, in the given `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedTweenSpec#(kotlin.Int,kotlin.Int,androidx.compose.animation.core.Easing)` using the given `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedTweenSpec#(kotlin.Int,kotlin.Int,androidx.compose.animation.core.Easing)` curve. |

*** ** * ** ***

Base class for `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec`s that are based on a fixed `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedDurationBasedAnimationSpec#durationMillis()`.

## Summary

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedDurationBasedAnimationSpec#getDurationNanos(androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector)(initialValue: V, targetValue: V, initialVelocity: V)` Calculates the duration of an animation. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedDurationBasedAnimationSpec#delayMillis()` delay defines the amount of time that animation can be delayed. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedDurationBasedAnimationSpec#durationMillis()` duration is the amount of time while animation is not yet finished. | Cmn |

### Inherited functions

From [androidx.compose.animation.core.VectorizedAnimationSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec) `open V` `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec#getEndVelocity(androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector)(initialValue: V, targetValue: V, initialVelocity: V)`

Calculates the end velocity of the animation with the provided start/end values, and start velocity.
Cmn `V` `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec#getValueFromNanos(kotlin.Long,androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector)(
playTimeNanos: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html,
initialValue: V,
targetValue: V,
initialVelocity: V
)`

Calculates the value of the animation at given the playtime, with the provided start/end values, and start velocity.
Cmn `V` `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec#getVelocityFromNanos(kotlin.Long,androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector)(
playTimeNanos: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html,
initialValue: V,
targetValue: V,
initialVelocity: V
)`

Calculates the velocity of the animation at given the playtime, with the provided start/end values, and start velocity.
Cmn

### Inherited properties

From [androidx.compose.animation.core.VectorizedFiniteAnimationSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedFiniteAnimationSpec) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedFiniteAnimationSpec#isInfinite()`

Whether or not the `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec` specifies an infinite animation.
Cmn

## Public functions

### getDurationNanos

Cmn

```
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 `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec#getDurationNanos(androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector)`, `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec#getDurationNanos(androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector)` values, and `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec#getDurationNanos(androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector,androidx.compose.animation.core.AnimationVector)`.

| Parameters |
|---|---|
| `initialValue: V` | start value of the animation |
| `targetValue: V` | end value of the animation |
| `initialVelocity: V` | start velocity of the animation |

## Public properties

### delayMillis

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.0.0)

```
val delayMillis: Int
```

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

### durationMillis

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.0.0)

```
val durationMillis: Int
```

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