@@ -22,7 +22,7 @@ export class RootLayout extends RootLayoutBase {
22
22
onTouch : function ( view , event ) {
23
23
return true ;
24
24
} ,
25
- } )
25
+ } ) ,
26
26
) ;
27
27
}
28
28
}
@@ -63,9 +63,9 @@ export class RootLayout extends RootLayoutBase {
63
63
rotate : 0 ,
64
64
opacity : options . opacity ,
65
65
} ,
66
- options . color
66
+ options . color ,
67
67
) ,
68
- duration
68
+ duration ,
69
69
) ;
70
70
}
71
71
@@ -78,17 +78,17 @@ export class RootLayout extends RootLayoutBase {
78
78
}
79
79
80
80
private _getAnimationSet ( view : View , shadeCoverAnimation : TransitionAnimation , backgroundColor : string = defaultShadeCoverOptions . color ) : Array < android . animation . Animator > {
81
- const backgroundIsGradient = backgroundColor . startsWith ( 'linear-gradient' ) ;
81
+ const isBackgroundGradient = backgroundColor && backgroundColor . startsWith ( 'linear-gradient' ) ;
82
82
83
- const animationSet = Array . create ( android . animation . Animator , backgroundIsGradient ? 6 : 7 ) ;
83
+ const animationSet = Array . create ( android . animation . Animator , isBackgroundGradient ? 6 : 7 ) ;
84
84
animationSet [ 0 ] = android . animation . ObjectAnimator . ofFloat ( view . nativeViewProtected , 'translationX' , [ shadeCoverAnimation . translateX ] ) ;
85
85
animationSet [ 1 ] = android . animation . ObjectAnimator . ofFloat ( view . nativeViewProtected , 'translationY' , [ shadeCoverAnimation . translateY ] ) ;
86
86
animationSet [ 2 ] = android . animation . ObjectAnimator . ofFloat ( view . nativeViewProtected , 'scaleX' , [ shadeCoverAnimation . scaleX ] ) ;
87
87
animationSet [ 3 ] = android . animation . ObjectAnimator . ofFloat ( view . nativeViewProtected , 'scaleY' , [ shadeCoverAnimation . scaleY ] ) ;
88
88
animationSet [ 4 ] = android . animation . ObjectAnimator . ofFloat ( view . nativeViewProtected , 'rotation' , [ shadeCoverAnimation . rotate ] ) ;
89
89
animationSet [ 5 ] = android . animation . ObjectAnimator . ofFloat ( view . nativeViewProtected , 'alpha' , [ shadeCoverAnimation . opacity ] ) ;
90
90
91
- if ( backgroundIsGradient ) {
91
+ if ( isBackgroundGradient ) {
92
92
if ( view . backgroundColor ) {
93
93
view . backgroundColor = undefined ;
94
94
}
@@ -105,16 +105,17 @@ export class RootLayout extends RootLayoutBase {
105
105
106
106
private _getBackgroundColorAnimator ( view : View , backgroundColor : string ) : android . animation . ValueAnimator {
107
107
const nativeArray = Array . create ( java . lang . Object , 2 ) ;
108
- nativeArray [ 0 ] = view . backgroundColor ? java . lang . Integer . valueOf ( ( < Color > view . backgroundColor ) . argb ) : java . lang . Integer . valueOf ( - 1 ) ;
109
- nativeArray [ 1 ] = java . lang . Integer . valueOf ( new Color ( backgroundColor ) . argb ) ;
108
+
109
+ nativeArray [ 0 ] = java . lang . Integer . valueOf ( view . backgroundColor ? ( < Color > view . backgroundColor ) . argb : - 1 ) ;
110
+ nativeArray [ 1 ] = java . lang . Integer . valueOf ( backgroundColor ? new Color ( backgroundColor ) . argb : - 1 ) ;
110
111
const backgroundColorAnimator = android . animation . ValueAnimator . ofObject ( new android . animation . ArgbEvaluator ( ) , nativeArray ) ;
111
112
backgroundColorAnimator . addUpdateListener (
112
113
new android . animation . ValueAnimator . AnimatorUpdateListener ( {
113
114
onAnimationUpdate ( animator : android . animation . ValueAnimator ) {
114
115
const argb = ( < java . lang . Integer > animator . getAnimatedValue ( ) ) . intValue ( ) ;
115
116
view . backgroundColor = new Color ( argb );
116
117
} ,
117
- } )
118
+ } ) ,
118
119
) ;
119
120
return backgroundColorAnimator ;
120
121
}
@@ -132,7 +133,7 @@ export class RootLayout extends RootLayoutBase {
132
133
} ,
133
134
onAnimationRepeat : function ( animator : android . animation . Animator ) : void { } ,
134
135
onAnimationCancel : function ( animator : android . animation . Animator ) : void { } ,
135
- } )
136
+ } ) ,
136
137
) ;
137
138
animatorSet . start ( ) ;
138
139
} ) ;
0 commit comments