Fixed: Visual states not working properly when the animation is canceled in Android

This commit is contained in:
Tsvetan Raikov
2016-04-07 18:58:55 +03:00
parent 19acc86e26
commit c07fc07348
7 changed files with 145 additions and 90 deletions

View File

@@ -90,9 +90,12 @@ export class CssSelector {
});
if (this.animations && view.isLoaded) {
for (let animationInfo of this.animations) {
let realAnimation = keyframeAnimation.KeyframeAnimation.keyframeAnimationFromInfo(animationInfo, modifier);
if (realAnimation) {
realAnimation.play(view);
let animation = keyframeAnimation.KeyframeAnimation.keyframeAnimationFromInfo(animationInfo, modifier);
if (animation) {
view._registerAnimation(animation);
animation.play(view)
.then(() => { view._unregisterAnimation(animation); })
.catch((e) => { view._unregisterAnimation(animation); });
}
}
}

View File

@@ -83,6 +83,8 @@ function resetProperties(view: viewModule.View, oldState: VisualState, newState:
}
}
view._unregisterAllAnimations();
for (let selector of oldState.animatedSelectors) {
for (let animationInfo of selector.animations) {
for (let keyframe of animationInfo.keyframes) {