Skip to content

Commit 242c3ae

Browse files
authored
fix(android): RootLayout shade cover blinking animation (#10750)
1 parent a11ccd8 commit 242c3ae

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/core/ui/layouts/root-layout/index.android.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ export class RootLayout extends RootLayoutBase {
7676
return this._playAnimation(this._getAnimationSet(view, exitState), exitState?.duration);
7777
}
7878

79-
private _getAnimationSet(view: View, shadeCoverAnimation: TransitionAnimation, backgroundColor: string = defaultShadeCoverOptions.color): Array<android.animation.Animator> {
79+
private _getAnimationSet(view: View, shadeCoverAnimation: TransitionAnimation, backgroundColor?: string): Array<android.animation.Animator> {
8080
const isBackgroundGradient = backgroundColor && backgroundColor.startsWith('linear-gradient');
8181

82-
const animationSet = Array.create(android.animation.Animator, isBackgroundGradient ? 6 : 7);
82+
const animationSet = Array.create(android.animation.Animator, !backgroundColor || isBackgroundGradient ? 6 : 7);
8383
animationSet[0] = android.animation.ObjectAnimator.ofFloat(view.nativeViewProtected, 'translationX', [shadeCoverAnimation.translateX]);
8484
animationSet[1] = android.animation.ObjectAnimator.ofFloat(view.nativeViewProtected, 'translationY', [shadeCoverAnimation.translateY]);
8585
animationSet[2] = android.animation.ObjectAnimator.ofFloat(view.nativeViewProtected, 'scaleX', [shadeCoverAnimation.scaleX]);
@@ -97,7 +97,10 @@ export class RootLayout extends RootLayoutBase {
9797
if (view.backgroundImage) {
9898
view.backgroundImage = undefined;
9999
}
100-
animationSet[6] = this._getBackgroundColorAnimator(view, backgroundColor);
100+
101+
if (backgroundColor) {
102+
animationSet[6] = this._getBackgroundColorAnimator(view, backgroundColor);
103+
}
101104
}
102105
return animationSet;
103106
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy