8000 fix(android): RootLayout shade cover blinking animation · NativeScript/NativeScript@1781771 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1781771

Browse files
committed
fix(android): RootLayout shade cover blinking animation
1 parent 69ba9b7 commit 1781771

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)
0