Stopping on the last frame when the animation ends.
It would be great to add the ability to stop the animation on the last frame if the loop is set to false. Currently, the Stop method is being called there, and this method resets the frame to 0.
Hello @ivanmazur62, thanks for a nice suggestion! I can add an additional parameter to the Animated Image / Button "stopAtTheLastFrame" which will be false by default. So that if you need this setting, you need to enable it explicitly. What do you think?
Yes, this is a great solution. There's also another issue, on devices it sometimes skips the last frames for some reason, and then the animation stop doesn't trigger, and it goes in a loop. I added the transfer of the Loop parameter from the AnimatedImage class to the LottieAnimation class and handle the stop there.
Thank you for additional report. I understand why it can happen when the non loop animation does not stop. It can happen that the device delta time between frames is sometimes bigger that the animation time delta and the animation skips one or more frames. I'll handle this case with more care. Thank you! But there is a hard (==) check to stop the animation when loop is false:
if (!_loop && _lottieAnimation.CurrentFrame == _lottieAnimation.TotalFramesCount - 1)