@@ -32,9 +32,9 @@ export class Animation extends common.Animation implements definition.Animation
32
32
private _propertyUpdateCallbacks : Array < Function > ;
33
33
private _propertyResetCallbacks : Array < Function > ;
34
34
private _valueSource : number ;
35
-
35
+
36
36
public play ( ) : definition . AnimationPromise {
37
- var animationFinishedPromise = super . play ( ) ;
37
+ let animationFinishedPromise = super . play ( ) ;
38
38
39
39
let i : number ;
40
40
let length : number ;
@@ -58,11 +58,13 @@ export class Animation extends common.Animation implements definition.Animation
58
58
59
59
this . _animatorSet = new android . animation . AnimatorSet ( ) ;
60
60
this . _animatorSet . addListener ( this . _animatorListener ) ;
61
- if ( this . _playSequentially ) {
62
- this . _animatorSet . playSequentially ( this . _nativeAnimatorsArray ) ;
63
- }
64
- else {
65
- this . _animatorSet . playTogether ( this . _nativeAnimatorsArray ) ;
61
+ if ( length > 0 ) {
62
+ if ( this . _playSequentially ) {
63
+ this . _animatorSet . playSequentially ( this . _nativeAnimatorsArray ) ;
64
+ }
65
+ else {
66
+ this . _animatorSet . playTogether ( this . _nativeAnimatorsArray ) ;
67
+ }
66
68
}
67
69
68
70
trace . write ( "Starting " + this . _nativeAnimatorsArray . length + " animations " + ( this . _playSequentially ? "sequentially." : "together." ) , trace . categories . Animation ) ;
@@ -127,6 +129,11 @@ export class Animation extends common.Animation implements definition.Animation
127
129
}
128
130
129
131
private _createAnimators ( propertyAnimation : common . PropertyAnimation ) : void {
132
+
133
+ if ( ! propertyAnimation . target . _nativeView ) {
134
+ return ;
135
+ }
136
+
130
137
trace . write ( "Creating ObjectAnimator(s) for animation: " + common . Animation . _getAnimationInfo ( propertyAnimation ) + "..." , trace . categories . Animation ) ;
131
138
132
139
if ( types . isNullOrUndefined ( propertyAnimation . target ) ) {
0 commit comments