Merge pull request #3954 from NativeScript/animations-reset

Fix animation's "Reset"
This commit is contained in:
Panayot Cankov
2017-04-07 10:55:13 +03:00
committed by GitHub
3 changed files with 4 additions and 2 deletions

View File

@ -92,6 +92,7 @@ export class Animation extends AnimationBase {
constructor(animationDefinitions: Array<AnimationDefinitionInternal>, playSequentially?: boolean) {
super(animationDefinitions, playSequentially);
this._valueSource = "animation";
if (animationDefinitions.length > 0 && animationDefinitions[0].valueSource !== undefined) {
this._valueSource = animationDefinitions[0].valueSource;
}
@ -275,7 +276,7 @@ export class Animation extends AnimationBase {
animator.addUpdateListener(new android.animation.ValueAnimator.AnimatorUpdateListener({
onAnimationUpdate(animator: android.animation.ValueAnimator) {
let argb = (<java.lang.Integer>animator.getAnimatedValue()).intValue();
propertyAnimation.target.style[backgroundColorProperty.cssName] = new Color(argb);
propertyAnimation.target.style[setLocal ? backgroundColorProperty.name : backgroundColorProperty.keyframe] = new Color(argb);
}
}));

View File

@ -153,6 +153,7 @@ export class Animation extends AnimationBase {
constructor(animationDefinitions: Array<AnimationDefinitionInternal>, playSequentially?: boolean) {
super(animationDefinitions, playSequentially);
this._valueSource = "animation";
if (animationDefinitions.length > 0 && animationDefinitions[0].valueSource !== undefined) {
this._valueSource = animationDefinitions[0].valueSource;
}

View File

@ -339,7 +339,7 @@ export class View extends ViewCommon {
return this.nativeView.getAlpha();
}
[opacityProperty.setNative](value: number) {
this.nativeView.setAlpha(value);
this.nativeView.setAlpha(float(value));
}
[horizontalAlignmentProperty.getDefault](): HorizontalAlignment {