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
Merged

Fix LottieAnimation recomposes on every frame degrading performance #2078

merged 2 commits into from
May 24, 2022

Conversation

MSDarwish2000
Copy link
Contributor

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.

Copy link
Collaborator

@gpeal gpeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@MSDarwish2000
Copy link
Contributor Author

@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.

Compose: LottieAnimation recomposes on every frame degrading performance
2 participants