# FiniteAnimationSpec

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/AnimationSpec.kt+class:androidx.compose.animation.core.FiniteAnimationSpec) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.0.0) Common/All
- Cmn

  ```
  interface FiniteAnimationSpec<T : Any?> : AnimationSpec<T>
  ```
Known direct subclasses [DurationBasedAnimationSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DurationBasedAnimationSpec), [RepeatableSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/RepeatableSpec), [SpringSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DurationBasedAnimationSpec` | This describes `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec`s that are based on a fixed duration, such as `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpec`, `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec`, and `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SnapSpec`. |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/RepeatableSpec` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/RepeatableSpec` takes another `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DurationBasedAnimationSpec` and plays it `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/RepeatableSpec#(kotlin.Int,androidx.compose.animation.core.DurationBasedAnimationSpec,androidx.compose.animation.core.RepeatMode,androidx.compose.animation.core.StartOffset)` times. |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec` | Creates a `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec` that uses the given spring constants (i.e. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec#(kotlin.Float,kotlin.Float,kotlin.Any)` and `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec#(kotlin.Float,kotlin.Float,kotlin.Any)`. |

Known indirect subclasses [ArcAnimationSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcAnimationSpec), [KeyframesSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpec), [KeyframesWithSplineSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesWithSplineSpec), [SnapSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SnapSpec), [TweenSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/ArcAnimationSpec` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DurationBasedAnimationSpec` that interpolates 2-dimensional values using arcs of quarter of an Ellipse. |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpec` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpec` creates a `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedKeyframesSpec` animation. |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesWithSplineSpec` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesWithSplineSpec` creates a keyframe based `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/DurationBasedAnimationSpec` using the Monotone cubic Hermite spline to interpolate between the values in `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesWithSplineSpec#config()`. |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SnapSpec` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SnapSpec` describes a jump-cut type of animation. |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec` | Creates a TweenSpec configured with the given duration, delay, and easing curve. |

*** ** * ** ***

`https://developer.android.com/reference/kotlin/androidx/compose/animation/core/FiniteAnimationSpec` is the interface that all non-infinite `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec`s implement, including: `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec`, `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec`, `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpec`, `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/RepeatableSpec`, `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SnapSpec`, etc. By definition, `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/InfiniteRepeatableSpec` **does not** implement this interface.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/InfiniteRepeatableSpec` |   |

## Summary

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedFiniteAnimationSpec<V>` | `<V : https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector> https://developer.android.com/reference/kotlin/androidx/compose/animation/core/FiniteAnimationSpec#vectorize(androidx.compose.animation.core.TwoWayConverter)(converter: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TwoWayConverter<T, V>)` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec` with the given `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TwoWayConverter`. | Cmn |

## Public functions

### vectorize

Cmn

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

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec` with the given `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TwoWayConverter`.

The underlying animation system operates on `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector`s. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec` will be converted to `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector` to animate. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec` describes how the converted `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector` should be animated. E.g. The animation could simply interpolate between the start and end values (i.e.`https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec`), or apply spring physics to produce the motion (i.e. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec`), etc)

| Parameters |
|---|---|
| `converter: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TwoWayConverter<T, V>` | converts the type `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec` from and to `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector` type |