Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(navigationbar): add NavigationBar plugin #826

Merged
merged 6 commits into from
Jan 20, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ 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 { NavigationBar } from './plugins/navigationbar';
import { Market } from './plugins/market';
import { MediaPlugin } from './plugins/media';
import { Mixpanel } from './plugins/mixpanel';
Expand Down Expand Up @@ -185,6 +186,7 @@ export * from './plugins/music-controls';
export * from './plugins/native-audio';
export * from './plugins/native-page-transitions';
export * from './plugins/nativestorage';
export * from './plugins/navigationbar';
export * from './plugins/network';
export * from './plugins/nfc';
export * from './plugins/onesignal';
Expand Down Expand Up @@ -295,6 +297,7 @@ window['IonicNative'] = {
NativeAudio,
NativePageTransitions,
NativeStorage,
NavigationBar,
Network,
PayPal,
NFC,
Expand Down
34 changes: 34 additions & 0 deletions src/plugins/navigationbar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Cordova, Plugin } from './plugin';


/**
* @name NavigationBar
* @description
* The NavigationBar plugin can you to hide and auto hide the android navigation bar.
*
* @usage
* ```typescript
* import { NavigationBar } from 'ionic-native';
*
* let autoHide: boolean = true;
* NavigationBar.hide(autoHide);
* ```
*/
@Plugin({
name: 'NavigationBar',
plugin: 'cordova-plugin-navigationbar',
pluginRef: 'plugins.navigationbar',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it should be navigationbar instead

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right.. it is navigationbar

repo: 'https://github.com/cranberrygame/cordova-plugin-navigationbar',
platforms: ['Android']
})
export class NavigationBar {

/**
* Hide the navigation bar.
* @param autohide {boolean}
* @param callbacks {Object} Optional callbacks
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line and add:

@return {Promise<any>}

*/
@Cordova()
static setUp(autohide?: boolean = false, callbacks?: {success?: Function, failure?: Function}): void { }
Copy link
Collaborator

@ihadeed ihadeed Nov 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should return a Promise.

The decorator should include the following options:

@Cordova({
  callbackStyle: 'object',
  successName: 'success',
  errorName: 'failure'
})

Then finally remove the callbacks parameter.


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't you missing hideNavigationBar definition?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}