snapTo

abstract suspend fun snapTo(composition: LottieComposition? = this.composition, progress: Float = this.progress, iteration: Int = this.iteration, resetLastFrameNanos: Boolean = progress != this.progress)

Snap to a specific point in an animation. This can be used to update the progress or iteration count of an ongoing animation. It will cancel any ongoing animations on this state class. To update and then resume an animation, call animate again with continueFromPreviousAnimate set to true after calling snapTo.

Parameters

composition

The LottieComposition that should be rendered. Defaults to LottieAnimatable.composition.

progress

The progress that should be set. Defaults to LottieAnimatable.progress

iteration

Updates the current iteration count. This can be used to "rewind" or "fast-forward" an ongoing animation to a past/future iteration count. Defaults to LottieAnimatable.iteration

resetLastFrameNanos

rememberLottieAnimatable keeps track of the frame time of the most recent animation. When animate is called with continueFromPreviousAnimate set to true, a delta will be calculated from the most recent animate call to ensure that the original progress is unaffected by snapTo calls in the middle. Defaults to false if progress is not being snapped to. Defaults to true if progress is being snapped to.