-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Compose] Add merge paths flag #1744
Conversation
This flag is set to false by default to align with LottieAnimationView. Added some documentation too
68f690d
to
3987b8e
Compare
lottie-compose/src/main/java/com/airbnb/lottie/compose/LottieAnimationState.kt
Outdated
Show resolved
Hide resolved
lottie-compose/src/main/java/com/airbnb/lottie/compose/LottieAnimation.kt
Outdated
Show resolved
Hide resolved
With this, we won't trigger a whole recomposition for these state changes
@gpeal I added a toggle for merge paths to the Compose sample. Let me know if you want to have that as part of this PR. lottie-compose-merge-paths-toggle-sample.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty close! Just a couple small comments.
lottie-compose/src/main/java/com/airbnb/lottie/compose/LottieAnimation.kt
Outdated
Show resolved
Hide resolved
lottie-compose/src/main/java/com/airbnb/lottie/compose/LottieAnimationState.kt
Outdated
Show resolved
Hide resolved
lottie-compose/src/main/java/com/airbnb/lottie/compose/LottieAnimationState.kt
Outdated
Show resolved
Hide resolved
e364984
to
4b8a5d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Awesome, thanks so much! |
In relation to #1734
LottieAnimationView
had merge paths disabled by default, butLottieAnimation
enables them by default. As long as merge paths contain known bugs, I think it makes sense not to change that behavior - what do you think?I added a flag for it to the state. If you want, we can add it as a constructor param too, but I feel like that's not needed as it's not that commonly used.
Cheers