# TweenSpec

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

  ```
  class TweenSpec<T : Any?> : DurationBasedAnimationSpec<T>
  ```

*** ** * ** ***

Creates a TweenSpec configured with the given duration, delay, and easing curve.

## Summary

| ### Public constructors |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec#TweenSpec(kotlin.Int,kotlin.Int,androidx.compose.animation.core.Easing)(durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, delay: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, easing: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing)` | Cmn |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec#hashCode()()` | Cmn |
| `open https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedTweenSpec<V>` | `<V : https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector> https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec#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 properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec#delay()` the number of milliseconds the animation waits before starting, 0 by default. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec#durationMillis()` duration of the `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedTweenSpec` animation. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec#easing()` the easing curve used by the animation. | Cmn |

## Public constructors

### TweenSpec

Cmn

```
<T : Any?> TweenSpec(
    durationMillis: Int = DefaultDurationMillis,
    delay: Int = 0,
    easing: Easing = FastOutSlowInEasing
)
```

| Parameters |
|---|---|
| `durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = DefaultDurationMillis` | duration of the `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedTweenSpec` animation. |
| `delay: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = 0` | the number of milliseconds the animation waits before starting, 0 by default. |
| `easing: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing = FastOutSlowInEasing` | the easing curve used by the animation. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/package-summary#FastOutSlowInEasing()` by default. |

## Public functions

### equals

Cmn

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

Cmn

```
open fun hashCode(): Int
```

### vectorize

Cmn

```
open fun <V : AnimationVector> vectorize(converter: TwoWayConverter<T, V>): VectorizedTweenSpec<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 |

## Public properties

### delay

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

```
val delay: Int
```

the number of milliseconds the animation waits before starting, 0 by default.

### durationMillis

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

```
val durationMillis: Int
```

duration of the `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedTweenSpec` animation.

### easing

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

```
val easing: Easing
```

the easing curve used by the animation. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/package-summary#FastOutSlowInEasing()` by default.