Package-level declarations

Types

Link copied to clipboard
class AnimatableCore<T>(initialValue: T, converter: AnimationConverter<T>)

Owns one mutable animated value without depending on composition.

Link copied to clipboard

Converts a domain value to and from independently interpolated floating-point dimensions.

Link copied to clipboard

Provides stateless converters for common scalar and Android-compatible packed values.

Link copied to clipboard

Identifies the terminal state observed by an animation loop that returns normally.

Link copied to clipboard
sealed interface AnimationSpec

Defines how the animation engine maps elapsed time to progress between two values.

Link copied to clipboard
class CubicBezierEasing(val x1: Float, val y1: Float, val x2: Float, val y2: Float) : Easing

Evaluates a cubic Bézier easing from (0, 0) through two control points to (1, 1).

Link copied to clipboard
fun interface Easing

Maps linear time progress to visual animation progress.

Link copied to clipboard

Provides allocation-stable easing curves for common motion profiles.

Link copied to clipboard
data class InfiniteRepeatableSpec(val animation: AnimationSpec, val repeatMode: RepeatMode = RepeatMode.Restart) : AnimationSpec

Repeats animation until the driving coroutine is cancelled.

Link copied to clipboard
data class Keyframe(val timeMillis: Int, val valueFraction: Float)

Defines one progress checkpoint in a KeyframesSpec.

Link copied to clipboard
data class KeyframesSpec(val durationMillis: Int, val keyframes: List<Keyframe>) : AnimationSpec

Interpolates progress linearly between timestamped keyframes.

Link copied to clipboard
data class RepeatableSpec(val iterations: Int, val animation: AnimationSpec, val repeatMode: RepeatMode = RepeatMode.Restart) : AnimationSpec

Repeats a finite animation for a fixed number of iterations.

Link copied to clipboard

Defines how a repeated animation chooses the direction of each cycle.

Link copied to clipboard
data object SnapSpec : AnimationSpec

Selects the target value immediately without interpolation.

Link copied to clipboard
data class SpringSpec(val dampingRatio: Float = 0.8f, val stiffness: Float = 250.0f, val durationMillis: Int = 550) : AnimationSpec

Approximates spring motion with a bounded damped oscillation over a fixed duration.

Link copied to clipboard
class TransitionCore<S>(initialState: S)

Coordinates segment state and one shared timeline for a multi-channel transition.

Link copied to clipboard
data class TweenSpec(val durationMillis: Int = 300, val delayMillis: Int = 0, val easing: Easing = EasingDefaults.FastOutSlowIn) : AnimationSpec

Maps a fixed-duration interval through an easing curve after an optional delay.

Functions

Link copied to clipboard

Returns the normalized total duration of spec in nanoseconds.

Link copied to clipboard
fun cubicBezier(x1: Float, y1: Float, x2: Float, y2: Float): Easing

Creates a cubic Bézier easing from two control points.

Link copied to clipboard
fun infiniteRepeatable(animation: AnimationSpec, repeatMode: RepeatMode = RepeatMode.Restart): InfiniteRepeatableSpec

Creates an animation that repeats until its driving coroutine is cancelled.

Link copied to clipboard
fun isAnimationFinished(spec: AnimationSpec, playTimeNanos: Long): Boolean

Returns whether playTimeNanos has reached the normalized finite duration of spec.

Link copied to clipboard
fun keyframe(timeMillis: Int, valueFraction: Float): Keyframe

Creates one timestamped progress checkpoint for keyframes.

Link copied to clipboard
fun keyframes(durationMillis: Int, vararg keyframes: Keyframe): KeyframesSpec

Creates a keyframe specification with checkpoints sorted by timestamp.

Link copied to clipboard
fun repeatable(iterations: Int, animation: AnimationSpec, repeatMode: RepeatMode = RepeatMode.Restart): RepeatableSpec

Creates a finite repeated animation.

Link copied to clipboard
suspend fun <T> runAnimation(frameClock: MonotonicFrameClock, startValue: T, endValue: T, animationSpec: AnimationSpec, converter: AnimationConverter<T>, onValue: (T) -> Unit): AnimationRunResult

Drives animationSpec with frameClock and publishes sampled values through onValue.

Link copied to clipboard
fun <T> sampleAnimationValue(startValue: T, endValue: T, animationSpec: AnimationSpec, converter: AnimationConverter<T>, playTimeNanos: Long): T

Returns the value of animationSpec at playTimeNanos without owning a clock or mutable state.

Link copied to clipboard
fun snap(): SnapSpec

Returns the shared specification that selects the target value immediately.

Link copied to clipboard
fun spring(dampingRatio: Float = 0.8f, stiffness: Float = 250.0f, durationMillis: Int = 550): SpringSpec

Creates a bounded duration-based spring approximation.

Link copied to clipboard
fun tween(durationMillis: Int = 300, delayMillis: Int = 0, easing: Easing = EasingDefaults.FastOutSlowIn): TweenSpec

Creates a fixed-duration easing specification.