mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
feat(native-page-transitions): add support for Native Page Transitions plugin (#488)
This commit is contained in:
parent
759f8ef910
commit
00d87dba98
@ -64,6 +64,7 @@ import { LaunchNavigator } from './plugins/launchnavigator';
|
||||
import { LocalNotifications } from './plugins/localnotifications';
|
||||
import { MediaCapture } from './plugins/media-capture';
|
||||
import { NativeAudio } from './plugins/native-audio';
|
||||
import { NativePageTransitions } from './plugins/native-page-transitions';
|
||||
import { NativeStorage } from './plugins/nativestorage';
|
||||
import { MediaPlugin } from './plugins/media';
|
||||
import { Network } from './plugins/network';
|
||||
@ -122,6 +123,7 @@ export * from './plugins/launchnavigator';
|
||||
export * from './plugins/localnotifications';
|
||||
export * from './plugins/media';
|
||||
export * from './plugins/media-capture';
|
||||
export * from './plugins/native-page-transitions';
|
||||
export * from './plugins/printer';
|
||||
export * from './plugins/push';
|
||||
export * from './plugins/safari-view-controller';
|
||||
@ -255,6 +257,7 @@ window['IonicNative'] = {
|
||||
MediaCapture: MediaCapture,
|
||||
MediaPlugin: MediaPlugin,
|
||||
NativeAudio: NativeAudio,
|
||||
NativePageTransitions: NativePageTransitions,
|
||||
NativeStorage: NativeStorage,
|
||||
Network: Network,
|
||||
Printer: Printer,
|
||||
|
86
src/plugins/native-page-transitions.ts
Normal file
86
src/plugins/native-page-transitions.ts
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user