mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 05:18:39 +08:00
fix(ios): stability around canceling an animation
This commit is contained in:
@ -222,16 +222,20 @@ export class Animation extends AnimationBase {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let i = 0;
|
if (this._mergedPropertyAnimations) {
|
||||||
const length = this._mergedPropertyAnimations.length;
|
for (let i = 0; i < this._mergedPropertyAnimations.length; i++) {
|
||||||
for (; i < length; i++) {
|
|
||||||
const propertyAnimation = this._mergedPropertyAnimations[i];
|
const propertyAnimation = this._mergedPropertyAnimations[i];
|
||||||
|
if (propertyAnimation) {
|
||||||
|
if (propertyAnimation.target?.nativeViewProtected?.layer) {
|
||||||
propertyAnimation.target.nativeViewProtected.layer.removeAllAnimations();
|
propertyAnimation.target.nativeViewProtected.layer.removeAllAnimations();
|
||||||
|
}
|
||||||
if (propertyAnimation._propertyResetCallback) {
|
if (propertyAnimation._propertyResetCallback) {
|
||||||
propertyAnimation._propertyResetCallback(propertyAnimation._originalValue, this._valueSource);
|
propertyAnimation._propertyResetCallback(propertyAnimation._originalValue, this._valueSource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public _resolveAnimationCurve(curve: string | CubicBezierAnimationCurve | CAMediaTimingFunction): CAMediaTimingFunction | string {
|
public _resolveAnimationCurve(curve: string | CubicBezierAnimationCurve | CAMediaTimingFunction): CAMediaTimingFunction | string {
|
||||||
return _resolveAnimationCurve(curve);
|
return _resolveAnimationCurve(curve);
|
||||||
@ -462,7 +466,6 @@ export class Animation extends AnimationBase {
|
|||||||
animationDelegate.nextAnimation = callback;
|
animationDelegate.nextAnimation = callback;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static _createGroupAnimation(args: AnimationInfo, animation: PropertyAnimation) {
|
private static _createGroupAnimation(args: AnimationInfo, animation: PropertyAnimation) {
|
||||||
|
Reference in New Issue
Block a user