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

Mitigate flickering on color animations #37925

Closed
wants to merge 1 commit into from

Conversation

genkikondo
Copy link
Contributor

Summary:
Vectorized animations (XY, Color) are split into multiple animations for each component that execute in parallel. Upon each of these animations completing, a rerender is triggered to sync the state back to the JS AnimatedValue nodes.

The problem with this is that calling update() on AnimatedProps when each animation completes results in potential flickering as all animations that are part of the vectorized animation may not have completed yet. For example, only the animation for the red channel of an animating color may have been completed, resulting in a temporary red color being rendered. So, for now, ignore AnimatedProps that use a vectorized animation.

Follow up will properly address vectorized animations - only call the update() when all animations complete.

Changelog:
[General][Fixed] - Mitigate flickering on color animations

Differential Revision: D46778405

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels Jun 15, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46778405

@analysis-bot
Copy link

analysis-bot commented Jun 16, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,754,736 +171
android hermes armeabi-v7a 8,067,535 +162
android hermes x86 9,248,070 +163
android hermes x86_64 9,096,497 +175
android jsc arm64-v8a 9,315,781 +1
android jsc armeabi-v7a 8,505,908 +1
android jsc x86 9,379,993 +4
android jsc x86_64 9,632,511 +10

Base commit: 84fc79f
Branch: main

Summary:
Pull Request resolved: facebook#37925

Vectorized animations (XY, Color) are split into multiple animations for each component that execute in parallel. Upon each of these animations completing, a rerender is triggered to sync the state back to the JS AnimatedValue nodes.

The problem with this is that calling update() on AnimatedProps when each animation completes results in potential flickering as all animations that are part of the vectorized animation may not have completed yet. For example, only the animation for the red channel of an animating color may have been completed, resulting in a temporary red color being rendered. So, for now, ignore AnimatedProps that use a vectorized animation.

Follow up will properly address vectorized animations - only call the update() when all animations complete.

Changelog:
[General][Fixed] - Mitigate flickering on color animations

Reviewed By: rshest

Differential Revision: D46778405

fbshipit-source-id: bad196129e6ce9ea6684437541556638fe7b0669
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46778405

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jun 16, 2023
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 5f8bbf2.

rshest added a commit to rshest/react-native that referenced this pull request Jun 24, 2023
Summary:
# Changelog:
[Internal] -

Reverting facebook#37925 as causing other animation issues.

Differential Revision: D46985440

fbshipit-source-id: 8a638eb4a0f9247387d1486132576af665ce7b1a
mxteroy pushed a commit to mxteroy/react-native that referenced this pull request Jun 29, 2023
Summary:
facebook#37925 mitigated an issue where vectorized animations (e.g. AnimatedColor) would flicker. This issue was never present in Android. In face, it somehow introduced the issues it solved for iOS onto Android.

## Changelog
[General][Fixed] - AnimatedColor flickering on Android

Differential Revision: D47114536

fbshipit-source-id: 3785d663808236bbd15ff49702564e5fe94d77e1
facebook-github-bot pushed a commit that referenced this pull request Jul 7, 2023
Summary:
Pull Request resolved: #38118

#37925 mitigated an issue where vectorized animations (e.g. AnimatedColor) would flicker. This issue was nearly not as present in Android (flickering rarely happens). In fact, it greatly increased the flickering issues on Android.

This will make it so that AnimatedProps that use vectorized animation are only ignored on iOS until a more robust fix is available.

## Changelog
[General][Fixed] - AnimatedColor flickering on Android

Reviewed By: javache

Differential Revision: D47114536

fbshipit-source-id: a61bb11a316594d12c070a3149863fe5973745c5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants