2016-03-05 03:56:22 +08:00
|
|
|
import {Plugin, Cordova, CordovaProperty} from './plugin';
|
2015-11-29 06:17:04 +08:00
|
|
|
|
2016-02-17 07:42:41 +08:00
|
|
|
declare var window;
|
2016-01-26 06:20:36 +08:00
|
|
|
|
|
|
|
/**
|
2016-03-13 07:30:16 +08:00
|
|
|
* @name StatusBar
|
|
|
|
* @description
|
2016-01-26 06:20:36 +08:00
|
|
|
* Manage the appearance of the native status bar.
|
|
|
|
*
|
2016-02-17 07:42:41 +08:00
|
|
|
* Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar).
|
2016-03-13 07:30:16 +08:00
|
|
|
*
|
|
|
|
* @usage
|
|
|
|
* ```ts
|
|
|
|
* StatuBar.overlaysWebView(true);
|
|
|
|
*
|
2016-03-13 07:56:01 +08:00
|
|
|
* StatusBar.
|
2016-03-13 07:30:16 +08:00
|
|
|
* ```
|
|
|
|
*
|
2016-01-26 06:20:36 +08:00
|
|
|
*/
|
2015-11-29 08:26:55 +08:00
|
|
|
@Plugin({
|
2015-11-29 06:17:04 +08:00
|
|
|
plugin: 'cordova-plugin-statusbar',
|
2016-02-23 05:20:00 +08:00
|
|
|
pluginRef: 'StatusBar',
|
|
|
|
repo: 'https://github.com/apache/cordova-plugin-statusbar'
|
2015-11-29 08:26:55 +08:00
|
|
|
})
|
|
|
|
export class StatusBar {
|
2016-01-26 06:20:36 +08:00
|
|
|
/**
|
|
|
|
* Set whether the status bar overlays the main app view. The default
|
|
|
|
* is true.
|
|
|
|
*
|
2016-02-17 07:42:41 +08:00
|
|
|
* @param {boolean} doesOverlay Whether the status bar overlays the main app view.
|
2016-01-26 06:20:36 +08:00
|
|
|
*/
|
2016-02-17 07:42:41 +08:00
|
|
|
@Cordova({
|
|
|
|
sync: true
|
|
|
|
})
|
|
|
|
static overlaysWebView(doesOverlay: boolean){};
|
2016-01-26 06:20:36 +08:00
|
|
|
|
2016-02-17 07:42:41 +08:00
|
|
|
/**
|
|
|
|
* Use the default statusbar (dark text, for light backgrounds).
|
|
|
|
*/
|
|
|
|
@Cordova({
|
|
|
|
sync: true
|
|
|
|
})
|
2015-11-30 09:54:45 +08:00
|
|
|
static styleDefault(){};
|
2016-01-26 06:20:36 +08:00
|
|
|
|
2016-02-17 07:42:41 +08:00
|
|
|
/**
|
|
|
|
* Use the lightContent statusbar (light text, for dark backgrounds).
|
|
|
|
*/
|
|
|
|
@Cordova({
|
|
|
|
sync: true
|
|
|
|
})
|
2015-11-30 09:54:45 +08:00
|
|
|
static styleLightContent(){};
|
2016-01-26 06:20:36 +08:00
|
|
|
|
2016-02-17 07:42:41 +08:00
|
|
|
/**
|
|
|
|
* Use the blackTranslucent statusbar (light text, for dark backgrounds).
|
|
|
|
*/
|
|
|
|
@Cordova({
|
|
|
|
sync: true
|
|
|
|
})
|
2015-11-30 09:54:45 +08:00
|
|
|
static styleBlackTranslucent(){};
|
2016-02-17 07:42:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Use the blackOpaque statusbar (light text, for dark backgrounds).
|
|
|
|
*/
|
|
|
|
@Cordova({
|
|
|
|
sync: true
|
|
|
|
})
|
2015-11-30 09:54:45 +08:00
|
|
|
static styleBlackOpaque(){};
|
2016-01-26 06:20:36 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the status bar to a specific named color. Valid options:
|
|
|
|
* black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown.
|
|
|
|
*
|
|
|
|
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing.
|
|
|
|
*
|
2016-02-17 07:42:41 +08:00
|
|
|
* @param {string} colorName The name of the color (from above)
|
2016-01-26 06:20:36 +08:00
|
|
|
*/
|
2016-02-17 07:42:41 +08:00
|
|
|
@Cordova({
|
|
|
|
sync: true
|
|
|
|
})
|
|
|
|
static backgroundColorByName(colorName: string){};
|
2016-01-26 06:20:36 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the status bar to a specific hex color (CSS shorthand supported!).
|
|
|
|
*
|
|
|
|
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing.
|
|
|
|
*
|
2016-02-17 07:42:41 +08:00
|
|
|
* @param {string} hexString The hex value of the color.
|
2016-01-26 06:20:36 +08:00
|
|
|
*/
|
2016-02-17 07:42:41 +08:00
|
|
|
@Cordova({
|
|
|
|
sync: true
|
|
|
|
})
|
|
|
|
static backgroundColorByHexString(hexString: string){};
|
2016-01-26 06:20:36 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Hide the StatusBar
|
|
|
|
*/
|
2016-02-17 07:42:41 +08:00
|
|
|
@Cordova({
|
|
|
|
sync: true
|
|
|
|
})
|
2015-11-30 09:54:45 +08:00
|
|
|
static hide(){};
|
2016-01-26 06:20:36 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Show the StatusBar
|
|
|
|
*/
|
2016-02-17 07:42:41 +08:00
|
|
|
@Cordova({
|
|
|
|
sync: true
|
|
|
|
})
|
2015-11-30 09:54:45 +08:00
|
|
|
static show(){};
|
2016-02-17 07:42:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether the StatusBar is currently visible or not.
|
|
|
|
*/
|
2016-03-05 03:56:22 +08:00
|
|
|
@CordovaProperty
|
2016-03-11 05:48:20 +08:00
|
|
|
static get isVisible() { return window.StatusBar.isVisible; }
|
2015-11-29 06:17:04 +08:00
|
|
|
}
|