-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(native-page-transitions): add support for Native Page Transition…
…s plugin (#488)
- Loading branch information
Showing
2 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import {Plugin, Cordova} from './plugin'; | ||
/** | ||
* @name NativePageTransitions | ||
* @description | ||
* The Native Page Transitions plugin uses native hardware acceleration to animate your transitions between views. You have complete control over the type of transition, the duration, and direction. | ||
* | ||
* @usage | ||
* ``` | ||
* import {NativePageTransitions, TransitionOptions} from 'ionic-native'; | ||
* | ||
* let options: TransitionOptions = { | ||
* direction: 'up', | ||
* duration: 500, | ||
* slowdownfactor: 3, | ||
* slidePixels: 20, | ||
* iosdelay: 100, | ||
* androiddelay: 150, | ||
* winphonedelay: 250, | ||
* fixedPixelsTop: 0, | ||
* fixedPixelsBottom: 60 | ||
* }; | ||
* | ||
* NativePageTransitions.slide(options) | ||
* .then(onSuccess) | ||
* .catch(onError); | ||
* | ||
* ``` | ||
*/ | ||
@Plugin({ | ||
plugin: 'com.telerik.plugins.nativepagetransitions', | ||
pluginRef: 'plugins.nativepagetransitions', | ||
repo: 'https://github.com/Telerik-Verified-Plugins/NativePageTransitions', | ||
platforms: ['iOS', 'Android', 'Windows Phone'] | ||
}) | ||
export class NativePageTransitions { | ||
/** | ||
* Perform a slide animation | ||
* @param options {TransitionOptions} Options for the transition | ||
*/ | ||
@Cordova() | ||
static slide(options: TransitionOptions): Promise<any> {return; } | ||
|
||
/** | ||
* Perform a flip animation | ||
* @param options {TransitionOptions} Options for the transition | ||
*/ | ||
@Cordova() | ||
static flip(options: TransitionOptions): Promise<any> {return; } | ||
|
||
/** | ||
* Perform a fade animation | ||
* @param options {TransitionOptions} Options for the transition | ||
*/ | ||
@Cordova({platforms: ['iOS', 'Android']}) | ||
static fade(options: TransitionOptions): Promise<any> {return; } | ||
|
||
|
||
/** | ||
* Perform a slide animation | ||
* @param options {TransitionOptions} Options for the transition | ||
*/ | ||
@Cordova({platforms: ['iOS', 'Android']}) | ||
static drawer(options: TransitionOptions): Promise<any> {return; } | ||
|
||
|
||
|
||
/** | ||
* Perform a slide animation | ||
* @param options {TransitionOptions} Options for the transition | ||
*/ | ||
@Cordova({platforms: ['iOS']}) | ||
static curl(options: TransitionOptions): Promise<any> {return; } | ||
|
||
} | ||
|
||
export interface TransitionOptions { | ||
direction?: string; | ||
duration?: number; | ||
slowdownfactor?: number; | ||
slidePixels?: number; | ||
iosdelay?: number; | ||
androiddelay?: number; | ||
winphonedelay?: number; | ||
fixedPixelsTops?: number; | ||
fixedPixelsBottom?: number; | ||
} |