KeyframesSpecConfig
class KeyframesSpecConfig<T>
kotlin.Any | |
↳ | androidx.compose.animation.core.KeyframesSpec.KeyframesSpecConfig |
KeyframesSpecConfig stores a mutable configuration of the key frames, including durationMillis, delayMillis, and all the key frames. Each key frame defines what the animation value should be at a particular time. Once the key frames are fully configured, the KeyframesSpecConfig can be used to create a KeyframesSpec.
import androidx.compose.animation.core.keyframes import androidx.compose.ui.unit.DpOffset // Use FastOutSlowInEasing for the interval from 0 to 50 ms, and LinearOutSlowInEasing for the // time between 50 and 100ms keyframes<DpOffset> { durationMillis = 200 DpOffset(0.dp, 0.dp) at 0 with LinearEasing DpOffset(500.dp, 100.dp) at 100 with LinearOutSlowInEasing DpOffset(400.dp, 50.dp) at 150 }
Summary
Public constructors | |
---|---|
<init>() KeyframesSpecConfig stores a mutable configuration of the key frames, including durationMillis, delayMillis, and all the key frames. |
Public methods | |
---|---|
infix KeyframesSpec.KeyframeEntity<T> |
Adds a keyframe so that animation value will be this at time: timeStamp. |
Boolean | |
Int |
hashCode() |
infix Unit |
KeyframesSpec.KeyframeEntity<T>.with(easing: Easing) Adds an Easing for the interval started with the just provided timestamp. |
Properties | |
---|---|
Int |
The amount of time that the animation should be delayed. |
Int |
Duration of the animation in milliseconds. |
Public constructors
<init>
KeyframesSpecConfig()
KeyframesSpecConfig stores a mutable configuration of the key frames, including durationMillis, delayMillis, and all the key frames. Each key frame defines what the animation value should be at a particular time. Once the key frames are fully configured, the KeyframesSpecConfig can be used to create a KeyframesSpec.
import androidx.compose.animation.core.keyframes import androidx.compose.ui.unit.DpOffset // Use FastOutSlowInEasing for the interval from 0 to 50 ms, and LinearOutSlowInEasing for the // time between 50 and 100ms keyframes<DpOffset> { durationMillis = 200 DpOffset(0.dp, 0.dp) at 0 with LinearEasing DpOffset(500.dp, 100.dp) at 100 with LinearOutSlowInEasing DpOffset(400.dp, 50.dp) at 150 }
See Also
Public methods
at
infix fun T.at(timeStamp: Int): KeyframesSpec.KeyframeEntity<T>
Adds a keyframe so that animation value will be this at time: timeStamp. For example: 0.8f at 150 // ms
Parameters | |
---|---|
timeStamp: Int | The time in the during when animation should reach value: this, with
a minimum value of 0 . |
Return | |
---|---|
an | KeyframeEntity so a custom Easing can be added by with method. |
hashCode
fun hashCode(): Int
with
infix fun KeyframesSpec.KeyframeEntity<T>.with(easing: Easing): Unit
Adds an Easing for the interval started with the just provided timestamp. For example: 0f at 50 with LinearEasing
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 with FastOutSlowInEasing 1.5f at 50 with LinearOutSlowInEasing 1f at 100 }
Parameters | |
---|---|
easing: Easing | Easing to be used for the next interval. |
Properties
delayMillis
var delayMillis: Int
The amount of time that the animation should be delayed. The minimum is 0
and defaults
to 0.
durationMillis
var durationMillis: Int
Duration of the animation in milliseconds. The minimum is 0
and defaults to
DefaultDurationMillis