Skip to content

Commit

Permalink
feat(native-page-transitions): add support for Native Page Transition…
Browse files Browse the repository at this point in the history
…s plugin (#488)
  • Loading branch information
ihadeed authored Aug 27, 2016
1 parent 759f8ef commit 00d87db
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -255,6 +257,7 @@ window['IonicNative'] = {
MediaCapture: MediaCapture,
MediaPlugin: MediaPlugin,
NativeAudio: NativeAudio,
NativePageTransitions: NativePageTransitions,
NativeStorage: NativeStorage,
Network: Network,
Printer: Printer,
Expand Down
86 changes: 86 additions & 0 deletions src/plugins/native-page-transitions.ts
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;
}

0 comments on commit 00d87db

Please sign in to comment.