mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 12:57:42 +08:00

Less than 30 erros left, let's hope it still works Added lib.*.d.ts from typescript, removed lib and dom stuff, added by hand XHR, alert etc. .d.ts-es for polyfills Roll back some changes involved in separating UIEvent for dom and ios Test combined dts-es will now use lib, while internally we will not to avoid UIEvent conflict with dom stuff
30 lines
1.2 KiB
TypeScript
30 lines
1.2 KiB
TypeScript
import transition = require("ui/transition");
|
|
|
|
export class CustomTransition extends transition.Transition {
|
|
constructor(duration: number, curve: any) {
|
|
super(duration, curve);
|
|
}
|
|
|
|
public animateIOSTransition(containerView: UIView, fromView: UIView, toView: UIView, operation: UINavigationControllerOperation, completion: (finished: boolean) => void): void {
|
|
toView.transform = CGAffineTransformMakeScale(0, 0);
|
|
fromView.transform = CGAffineTransformIdentity;
|
|
|
|
switch (operation) {
|
|
case UINavigationControllerOperation.Push:
|
|
containerView.insertSubviewAboveSubview(toView, fromView);
|
|
break;
|
|
case UINavigationControllerOperation.Pop:
|
|
containerView.insertSubviewBelowSubview(toView, fromView);
|
|
break;
|
|
}
|
|
|
|
var duration = this.getDuration();
|
|
var curve = this.getCurve();
|
|
UIView.animateWithDurationAnimationsCompletion(duration, () => {
|
|
UIView.setAnimationCurve(curve);
|
|
toView.transform = CGAffineTransformIdentity;
|
|
fromView.transform = CGAffineTransformMakeScale(0, 0);
|
|
}, completion);
|
|
}
|
|
}
|