-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Lottie play certain frames #166
Comments
I would like to have this as well for my projects. The previous Xamarin library we used from Airbnb had at least a Play and Stop method. The alternative SkiaSharp.Extended.UI.Maui doesn't provide these methods. Therefore, it's very hard to control animations in code. |
I think all of these actions can be performed using properties:
If you want to get a percent progress then you can convert the |
@mattleibow in order to achieve what i described in the issue, you'd need to do a while loop to monitor the progress in order to change You also can't reverse the animation either. For example, if you want to create an animated toggle using the following file - (for the sake of the example let's just assume there are 100 frames in the animation) When going from false to true, you'd want to play frames 0 to 80 The playSegments in this API automatically handles all that (the stopping at the right frame and changing the direction of the animation)
|
As @mattleibow said, you can play with those properties to be able to play just certain frames forward and backwards. You don't really need any loop to keep on checking the animation progress.
In my case I play the animation from 0 to millisecond 700. Then from 700 back to 0. In case you want to work with percentages, you can do it as well with a little math taking into account:
|
Be able to play to a certain frames. The lottie documentation has a
goToAndStop
I'd like to create a switch using a lottie animation, but without this sort of functionality its impossible.
https://lottiefiles.com/127464-animated-switch-ae-version
The text was updated successfully, but these errors were encountered: