Baseflow / LottieXamarin

Render After Effects animations natively on Android, iOS, MacOS and TvOS for Xamarin
https://baseflow.com
Apache License 2.0
1.22k stars 261 forks source link

StopAnimation does not reset the animation on Android #308

Closed joshardt closed 3 years ago

joshardt commented 3 years ago

🐛 Bug Report

The StopAnimation method does not reset the animation on Android. On iOS there are no problems. The interface documentation of StopAnimation is set to the following: "Will stop and reset the currently playing animation".

As a workaround I've tried to use animationView.PlayMinAndMaxProgress(0.0f, 0.0f); but this results in further problems because when I then restart the animation, the animation instantly finishes. Even when I set animationView.MaxProgress = float.MaxValue; I see no difference.

Expected behavior

The Animation gets reseted on Android when I use the StopAnimation method.

Reproduction steps

var animationView = new AnimationView();
animationView.Animation = "animation.json";

animationView.PlayAnimation();

animationView.OnFinishedAnimation += (sender, args) =>
{
    animationView.StopAnimation();
};

Configuration

Version: 4.0.6

Platform:

martijn00 commented 3 years ago

Can you make a PR?

joshardt commented 3 years ago

Yes, I can do it. But not sure when exactly. Christmas first 🎅

joshardt commented 3 years ago

@martijn00 please have a look on my PR.