Skip to content

Commit

Permalink
Only ignore AnimatedProps that use vectorized animation on iOS (#38118)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
James Maxell Eroy authored and facebook-github-bot committed Jul 7, 2023
1 parent 147a020 commit ec97646
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type {PlatformConfig} from '../AnimatedPlatformConfig';
import type AnimatedNode from '../nodes/AnimatedNode';
import type AnimatedValue from '../nodes/AnimatedValue';

import Platform from '../../Utilities/Platform';
import NativeAnimatedHelper from '../NativeAnimatedHelper';
import AnimatedColor from '../nodes/AnimatedColor';
import AnimatedProps from '../nodes/AnimatedProps';
Expand Down Expand Up @@ -84,7 +85,10 @@ export default class 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.
if (node instanceof AnimatedValueXY || node instanceof AnimatedColor) {
if (
Platform.OS === 'ios' &&
(node instanceof AnimatedValueXY || node instanceof AnimatedColor)
) {
return result;
}

Expand Down

0 comments on commit ec97646

Please sign in to comment.