stop

suspend fun stop()

Stops any on-going animation with a CancellationException.

This function will not return until the ongoing animation has been canceled (if any). Note, stop function does not skip the animation value to its target value. Rather the animation will be stopped in its track. Consider snapTo if it's desired to not only stop the animation but also snap the value to a given value.

See animateTo and animateDecay for more details about animation being canceled.

See also