mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-02 00:07:23 +08:00
feat(native-page-transitions): add support for Native Page Transitions plugin (#488)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user