Skip to content
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

Fix LottieAnimation recomposes on every frame degrading performance #2078

Merged
merged 2 commits into from May 24, 2022

Conversation

MSDarwish2000
Copy link
Contributor

@MSDarwish2000 MSDarwish2000 commented May 19, 2022

Fixes #2077

This issue can be fixed by a very simple approach mentioned in [https://developer.android.com/jetpack/compose/performance#defer-reads](Compose performance docs - Defer reads as long as possible) by deferring the progress read to the draw function.

Also, I've updated samples in this repo to use the new approach.

gpeal
gpeal approved these changes May 24, 2022
Copy link
Collaborator

@gpeal gpeal left a comment

Thanks for doing this. The API is a bit unfortunate but you're correct about the approach here. I'm going to land this and then do some small tweaks to APIs/docs and publish a release.
I'll leave the overload there but deprecated for one release and then will remove it.

@gpeal gpeal merged commit 122b950 into airbnb:master May 24, 2022
3 of 4 checks passed
@MSDarwish2000
Copy link
Contributor Author

MSDarwish2000 commented May 24, 2022

@gpeal Thank you for merging the pull request and maintaining this awesome project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants