public class InterruptionAwareAnimationSpec<T>(
public val animationSpec: FiniteAnimationSpec<T>,
public val interruptionSpec: FiniteAnimationSpec<T> = animationSpec,
) : FiniteAnimationSpec<T>
A FiniteAnimationSpec that uses animationSpec for uninterrupted animations and switches to interruptionSpec when a Transition, animateValueAsState, or Animatable.animateTo animation is interrupted mid-flight.
When a Transition is interrupted mid-flight, most FiniteAnimationSpec implementations (such as TweenSpec or KeyframesSpec, which ignore initial velocity) fall back to a default SpringSpec to avoid abrupt velocity discontinuities. Wrapping a spec in InterruptionAwareAnimationSpec overrides this fallback so Transition instead uses interruptionSpec (which defaults to animationSpec) and passes the current in-flight value and velocity to it. Similarly, when used with Animatable.animateTo or animate*AsState APIs (such as animateFloatAsState or animateValueAsState), animationSpec is used when starting from rest and interruptionSpec is used when the target value changes while an animation is already in-flight.
Functions
vectorize
override fun <V : AnimationVector> vectorize(
converter: TwoWayConverter<T, V>
): VectorizedFiniteAnimationSpec<V>
equals
override fun equals(other: Any?): Boolean
hashCode
override fun hashCode(): Int