net.kernelpanicsoft.archie.gui.animation¶
Types¶
AnimationSpec¶
data class AnimationSpec(val durationMillis: Duration = 220.milliseconds, val easing: Easing = Easings.OutCubic)
Timing parameters for float/int animations.
Easing¶
fun interface Easing
Describes a time-based interpolation used by Archie GUI animations.
Easings¶
object Easings
Common easing curves for small UI interactions.
Functions¶
animateFloat¶
@Composable
fun animateFloat(targetValue: Float, spec: AnimationSpec = AnimationSpec()): Float
Animates a float value toward targetValue using spec.
animateInt¶
@Composable
fun animateInt(targetValue: Int, spec: AnimationSpec = AnimationSpec()): Int
Animates an integer by interpolating as float and rounding to the nearest pixel.
animatePulse¶
@Composable
fun animatePulse(
key: Any?,
from: Float = 0.8f,
to: Float = 1.0f,
spec: AnimationSpec = AnimationSpec()
): Float
Sweeps from from to to every time key changes, holding at to otherwise - a one-shot "pulse"/"pop" effect for a discrete event (a checkbox toggling, a radio button being selected) rather than the continuous value animateFloat/animateInt track toward a moving target. Pair with Easings.OutBack for a satisfying overshoot-then-settle bounce.