lottie-ios icon indicating copy to clipboard operation
lottie-ios copied to clipboard

Setting the progress or using stop() plays the animation

Open DantePuglisi opened this issue 2 years ago • 2 comments

Check these before submitting:

  • [x] The issue doesn't involve an Unsupported Feature
  • [x] This issue isn't related to another open issue

This issue is a:

  • [x] Non-Crashing Bug (Visual or otherwise)

Which Version of Lottie are you using?

Lottie 3.0

What Platform are you on?

  • [x] iOS

What Language are you in?

  • [x] Swift

Expected Behavior

When using currentProgress or stop() on the AnimationView, the animation should move to that progress(or the start if using stop()) instantly.

Actual Behavior

When using currentProgress or stop() on the AnimationView, the animation plays to that progress (or the start if using stop()). I can't find a way to make the AnimationView "switch" to the new progress/frame instantly.

https://user-images.githubusercontent.com/6677483/125807090-82c9f5d7-7718-43fb-b67d-9d507fd36945.mp4

Code Example

That happens when doing

checkAnimation.currentProgress = 1.0

And the other way around if doing either

checkAnimation.currentProgress = 1.0 or checkAnimation.stop()

Animation JSON

I can't share the JSON publicly, if it's needed for debugging purposes let me know and I'll email it to you!

DantePuglisi avatar Jul 15 '21 14:07 DantePuglisi

@DantePuglisi I tried example from this repo and it seems this issue is related to your code and/or animation only. Could you please share more information?

Gargo avatar Jul 20 '21 21:07 Gargo

@Gargo Using this repo's example I added a animationView.stop() when the animation ends (so it goes to frame 0) and in the video you can see how it goes to 0 animating (really fast of course but not instantly as it should). The only change I did was adding that line after print("Animation Complete")

https://user-images.githubusercontent.com/6677483/126551353-d98b6a25-a3d7-4e31-8496-e759d6d32cc7.mov

DantePuglisi avatar Jul 21 '21 19:07 DantePuglisi

This no longer happens when using the Core Animation rendering engine, which is now the default as of Lottie 4.0

calda avatar Jan 23 '23 23:01 calda