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 unexpected crossfade animation when updating Lottie animation or rendering engine #2202

Merged
merged 2 commits into from
Sep 29, 2023

Conversation

calda
Copy link
Member

@calda calda commented Sep 28, 2023

This PR fixes an issue where updating the animation displayed by a LottieAnimationView, or its current rendering engine, would unexpectedly trigger a short crossfade animation.

This was a default implicit animation added by Core Animation, which we can disable by disabling it in actions.

This was a regression introduced by the architecture change that created the LottieAnimationLayer CALayer subclass (#2073). I think the CALayer of a UIView has all of these implicit actions disabled by default, so moving this code from a UIView subclass to a CALayer subclass changed the behavior of inserting a sublayer.

Fixes #2200:

Before After
2023-09-28 08 22 57 2023-09-28 08 30 41

This also fixes an issue I had noticed in the example app where the view would animate strangely when updating the rendering engine:

Before

2023-09-28 08 42 19

After

2023-09-28 08 41 51

fyi @eromanc in case you find this interesting / helpful

@calda calda mentioned this pull request Sep 28, 2023
@calda
Copy link
Member Author

calda commented Sep 29, 2023

ptal @thedrick

Copy link
Contributor

@thedrick thedrick left a comment

Choose a reason for hiding this comment

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

LGTM @calda sorry I thought I had already stamped this!

@calda
Copy link
Member Author

calda commented Sep 29, 2023

nppppp thanks for the review

@calda calda merged commit 45517c3 into master Sep 29, 2023
16 checks passed
@calda calda deleted the cal--fix-unexpected-layer-animation branch September 29, 2023 21:31
iago849 pushed a commit to atteamapps/lottie-ios that referenced this pull request Feb 8, 2024
MoroziOS pushed a commit to MoroziOS/tmg-lottie-ios that referenced this pull request May 22, 2024
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.

Motion trails since 4.3.0
2 participants