mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 18:12:09 +08:00

BREAKING CHANGE: AndroidTransitionType is now a static member of the Transition class. BEFORE: ``` import { AndroidTransitionType } from '@nativescript/core/ui/transition'; ``` AFTER: ``` import { Transition } from '@nativescript/core'; Transition.AndroidTransitionType.enter; // etc. ```
34 lines
915 B
TypeScript
34 lines
915 B
TypeScript
let transitionId = 0;
|
|
export class Transition {
|
|
static AndroidTransitionType = {};
|
|
private _duration: number;
|
|
private _curve: UIViewAnimationCurve;
|
|
private _id: number;
|
|
|
|
constructor(duration: number, curve: UIViewAnimationCurve = UIViewAnimationCurve.EaseInOut) {
|
|
this._duration = duration ? duration / 1000 : 0.35;
|
|
this._curve = curve;
|
|
this._id = transitionId++;
|
|
}
|
|
|
|
public getDuration(): number {
|
|
return this._duration;
|
|
}
|
|
|
|
public getCurve(): UIViewAnimationCurve {
|
|
return this._curve;
|
|
}
|
|
|
|
public animateIOSTransition(containerView: UIView, fromView: UIView, toView: UIView, operation: UINavigationControllerOperation, completion: (finished: boolean) => void): void {
|
|
throw new Error('Abstract method call');
|
|
}
|
|
|
|
public createAndroidAnimator(transitionType: string): any {
|
|
throw new Error('Abstract method call');
|
|
}
|
|
|
|
public toString(): string {
|
|
return `Transition@${this._id}`;
|
|
}
|
|
}
|