mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fixed: Visual states not working properly when the animation is canceled in Android
This commit is contained in:
@@ -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); });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user