mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
Merge pull request #2715 from NativeScript/pass-tests-ios10
All tests pass iOS10, fixing delegates with love...
This commit is contained in:
@ -81,6 +81,10 @@ function getNativeBusy(indicator: activityIndicatorModule.ActivityIndicator): bo
|
|||||||
return indicator.android.getVisibility() === android.view.View.VISIBLE;
|
return indicator.android.getVisibility() === android.view.View.VISIBLE;
|
||||||
}
|
}
|
||||||
else if (indicator.ios) {
|
else if (indicator.ios) {
|
||||||
return indicator.ios.isAnimating();
|
if ((indicator.ios as any).isAnimating) {
|
||||||
|
return (indicator.ios as any).isAnimating();
|
||||||
|
} else {
|
||||||
|
return (indicator.ios as UIActivityIndicatorView).animating;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,10 +41,13 @@ interface IOSView extends viewModule.View {
|
|||||||
_isPresentationLayerUpdateSuspeneded();
|
_isPresentationLayerUpdateSuspeneded();
|
||||||
}
|
}
|
||||||
|
|
||||||
class AnimationDelegateImpl extends NSObject {
|
class AnimationDelegateImpl extends NSObject implements CAAnimationDelegate {
|
||||||
|
|
||||||
public nextAnimation: Function;
|
public nextAnimation: Function;
|
||||||
|
|
||||||
|
// The CAAnimationDelegate protocol has been introduced in the iOS 10 SDK
|
||||||
|
static ObjCProtocols = global.CAAnimationDelegate ? [global.CAAnimationDelegate] : [];
|
||||||
|
|
||||||
private _finishedCallback: Function;
|
private _finishedCallback: Function;
|
||||||
private _propertyAnimation: PropertyAnimationInfo;
|
private _propertyAnimation: PropertyAnimationInfo;
|
||||||
private _valueSource: number;
|
private _valueSource: number;
|
||||||
@ -360,7 +363,7 @@ export class Animation extends common.Animation implements definition.Animation
|
|||||||
}
|
}
|
||||||
|
|
||||||
let animationDelegate = AnimationDelegateImpl.initWithFinishedCallback(finishedCallback, animation, valueSource);
|
let animationDelegate = AnimationDelegateImpl.initWithFinishedCallback(finishedCallback, animation, valueSource);
|
||||||
nativeAnimation.setValueForKey(animationDelegate, "delegate");
|
nativeAnimation.delegate = animationDelegate;
|
||||||
|
|
||||||
nativeView.layer.addAnimationForKey(nativeAnimation, args.propertyNameToAnimate);
|
nativeView.layer.addAnimationForKey(nativeAnimation, args.propertyNameToAnimate);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user