# KeyframesSpecBaseConfig

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

  ```
  sealed class KeyframesSpecBaseConfig<T : Any?, E : KeyframeBaseEntity<T>>
  ```
Known direct subclasses [KeyframesSpec.KeyframesSpecConfig](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpec.KeyframesSpecConfig), [KeyframesWithSplineSpec.KeyframesWithSplineSpecConfig](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesWithSplineSpec.KeyframesWithSplineSpecConfig)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpec.KeyframesSpecConfig` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpec.KeyframesSpecConfig` stores a mutable configuration of the key frames, including `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#durationMillis()`, `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#delayMillis()`, and all the key frames. |
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesWithSplineSpec.KeyframesWithSplineSpecConfig` | Keyframe configuration class for `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesWithSplineSpec`. |

*** ** * ** ***

Shared configuration class used as DSL for keyframe based animations.

## Summary

| ### Protected constructors |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, E : https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframeBaseEntity<T>> https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#KeyframesSpecBaseConfig()()` | Cmn |

| ### Public functions |
|---|---|---|
| `open infix E` | `T.https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#(kotlin.Any).at(kotlin.Int)(timeStamp: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Adds a keyframe so that animation value will be `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig` at time: `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#(kotlin.Any).at(kotlin.Int)`. | Cmn |
| `open infix E` | `T.https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#(kotlin.Any).atFraction(kotlin.Float)(fraction: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Adds a keyframe so that the animation value will be the value specified at a fraction of the total `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#durationMillis()` set. | Cmn |
| `infix E` | `E.https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#(androidx.compose.animation.core.KeyframeBaseEntity).using(androidx.compose.animation.core.Easing)(easing: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing)` Adds an `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing` for the interval started with the just provided timestamp. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#delayMillis()` The amount of time that the animation should be delayed. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#durationMillis()` Duration of the animation in milliseconds. | Cmn |

## Protected constructors

### KeyframesSpecBaseConfig

Cmn

```
protected <T : Any?, E : KeyframeBaseEntity<T>> KeyframesSpecBaseConfig()
```

## Public functions

### T.at

Cmn 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+function:at) Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.6.0)

```
open infix fun T.at(timeStamp: @IntRange(from = 0) Int): E
```

Adds a keyframe so that animation value will be `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig` at time: `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#(kotlin.Any).at(kotlin.Int)`. For example:

```kotlin
0.8f at 150 // ms
```

| Parameters |
|---|---|
| `timeStamp: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The time in the during when animation should reach value: `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig`, with a minimum value of `0`. |

| Returns |
|---|---|
| `E` | an instance of `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig` so a custom `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing` can be added by the `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#(androidx.compose.animation.core.KeyframeBaseEntity).using(androidx.compose.animation.core.Easing)` method. |

### T.atFraction

Cmn 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+function:atFraction) Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.6.0)

```
open infix fun T.atFraction(fraction: @FloatRange(from = 0.0, to = 1.0) Float): E
```

Adds a keyframe so that the animation value will be the value specified at a fraction of the total `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#durationMillis()` set. It's recommended that you always set `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#durationMillis()` before calling `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#(kotlin.Any).atFraction(kotlin.Float)`. For example:

```kotlin
// Make sure to set the duration before calling `atFraction` otherwise the keyframe will be set
// based on the default duration
durationMillis = 300
0.8f atFraction 0.50f // half of the overall duration set
```

| Parameters |
|---|---|
| `fraction: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The fraction when the animation should reach specified value. |

| Returns |
|---|---|
| `E` | an instance of `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig` so a custom `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing` can be added by the `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig#(androidx.compose.animation.core.KeyframeBaseEntity).using(androidx.compose.animation.core.Easing)` method |

### E.using

Cmn 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+function:using) Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.6.0)

```
infix fun E.using(easing: Easing): E
```

Adds an `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing` for the interval started with the just provided timestamp. For example: 0f at 50 using LinearEasing

```kotlin
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.keyframes

// Use FastOutSlowInEasing for the interval from 0 to 50 ms, and LinearOutSlowInEasing for the
// time between 50 and 100ms
keyframes<Float> {
    durationMillis = 100
    0f at 0 using FastOutSlowInEasing
    1.5f at 50 using LinearOutSlowInEasing
    1f at 100
}
```

| Parameters |
|---|---|
| `easing: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Easing` to be used for the next interval. |

| Returns |
|---|---|
| `E` | the same `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/KeyframesSpecBaseConfig` instance so that other implementations can expand on the builder pattern |

## Public properties

### delayMillis

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

```
var delayMillis: Int
```

The amount of time that the animation should be delayed. The minimum is `0` and defaults to 0.

### durationMillis

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

```
var durationMillis: Int
```

Duration of the animation in milliseconds. The minimum is `0` and defaults to `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationConstants#DefaultDurationMillis()`