Animations were always played as keyframes and kept overriding the local values. Android setAlpha has deprecated int overload, now it is guided to use the float one. Android background color was animated using css values instead of local or the keyframe one.

This commit is contained in:
Panayot Cankov
2017-04-06 14:50:40 +03:00
parent 70ae742f00
commit 92d015b8d8
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 {