mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
chore(statusbar): update StatusBar
This commit is contained in:
parent
f1c2347a9a
commit
44d6d5c021
40
dist/plugins/statusbar.d.ts
vendored
40
dist/plugins/statusbar.d.ts
vendored
@ -1,24 +1,31 @@
|
||||
/**
|
||||
* Manage the appearance of the native status bar.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* StatusBar.hide(); // Hide the bar
|
||||
*
|
||||
* StatusBar.setStyle(StatusBar.LIGHT_CONTENT) // Good for dark backgrounds
|
||||
* ```
|
||||
* Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar).
|
||||
*/
|
||||
export declare class StatusBar {
|
||||
/**
|
||||
* Set whether the status bar overlays the main app view. The default
|
||||
* is true.
|
||||
*
|
||||
* @param doesOverlay whether the status bar overlays the main app view.
|
||||
* @param {boolean} doesOverlay Whether the status bar overlays the main app view.
|
||||
*/
|
||||
static overlaysWebView(doesOverlay: boolean): void;
|
||||
/**
|
||||
* Use the default statusbar (dark text, for light backgrounds).
|
||||
*/
|
||||
static overlaysWebView(doOverlay: boolean): void;
|
||||
static styleDefault(): void;
|
||||
/**
|
||||
* Use the lightContent statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
static styleLightContent(): void;
|
||||
/**
|
||||
* Use the blackTranslucent statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
static styleBlackTranslucent(): void;
|
||||
/**
|
||||
* Use the blackOpaque statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
static styleBlackOpaque(): void;
|
||||
/**
|
||||
* Set the status bar to a specific named color. Valid options:
|
||||
@ -26,7 +33,7 @@ export declare class StatusBar {
|
||||
*
|
||||
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing.
|
||||
*
|
||||
* @param name the name of the color (from above)
|
||||
* @param {string} colorName The name of the color (from above)
|
||||
*/
|
||||
static backgroundColorByName(colorName: string): void;
|
||||
/**
|
||||
@ -34,24 +41,19 @@ export declare class StatusBar {
|
||||
*
|
||||
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing.
|
||||
*
|
||||
* @param hex the hex value of the color.
|
||||
* @param {string} hexString The hex value of the color.
|
||||
*/
|
||||
static backgroundColorByHexString(hexString: string): void;
|
||||
/**
|
||||
* Hide the StatusBar
|
||||
*
|
||||
* Options:
|
||||
*
|
||||
* StatusBar.DEFAULT
|
||||
* StatusBar.LIGHT_CONTENT
|
||||
* StatusBar.BLACK_TRANSLUCENT
|
||||
* StatusBar.BLACK_OPAQUE
|
||||
*
|
||||
* @param style the style from above
|
||||
*/
|
||||
static hide(): void;
|
||||
/**
|
||||
* Show the StatusBar
|
||||
*/
|
||||
static show(): void;
|
||||
/**
|
||||
* Whether the StatusBar is currently visible or not.
|
||||
*/
|
||||
static isVisible(): any;
|
||||
}
|
||||
|
81
dist/plugins/statusbar.js
vendored
81
dist/plugins/statusbar.js
vendored
@ -8,12 +8,7 @@ var plugin_1 = require('./plugin');
|
||||
/**
|
||||
* Manage the appearance of the native status bar.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* StatusBar.hide(); // Hide the bar
|
||||
*
|
||||
* StatusBar.setStyle(StatusBar.LIGHT_CONTENT) // Good for dark backgrounds
|
||||
* ```
|
||||
* Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar).
|
||||
*/
|
||||
var StatusBar = (function () {
|
||||
function StatusBar() {
|
||||
@ -22,16 +17,28 @@ var StatusBar = (function () {
|
||||
* Set whether the status bar overlays the main app view. The default
|
||||
* is true.
|
||||
*
|
||||
* @param doesOverlay whether the status bar overlays the main app view.
|
||||
* @param {boolean} doesOverlay Whether the status bar overlays the main app view.
|
||||
*/
|
||||
StatusBar.overlaysWebView = function (doOverlay) { };
|
||||
StatusBar.overlaysWebView = function (doesOverlay) { };
|
||||
;
|
||||
/**
|
||||
* Use the default statusbar (dark text, for light backgrounds).
|
||||
*/
|
||||
StatusBar.styleDefault = function () { };
|
||||
;
|
||||
/**
|
||||
* Use the lightContent statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
StatusBar.styleLightContent = function () { };
|
||||
;
|
||||
/**
|
||||
* Use the blackTranslucent statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
StatusBar.styleBlackTranslucent = function () { };
|
||||
;
|
||||
/**
|
||||
* Use the blackOpaque statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
StatusBar.styleBlackOpaque = function () { };
|
||||
;
|
||||
/**
|
||||
@ -40,7 +47,7 @@ var StatusBar = (function () {
|
||||
*
|
||||
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing.
|
||||
*
|
||||
* @param name the name of the color (from above)
|
||||
* @param {string} colorName The name of the color (from above)
|
||||
*/
|
||||
StatusBar.backgroundColorByName = function (colorName) { };
|
||||
;
|
||||
@ -49,21 +56,12 @@ var StatusBar = (function () {
|
||||
*
|
||||
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing.
|
||||
*
|
||||
* @param hex the hex value of the color.
|
||||
* @param {string} hexString The hex value of the color.
|
||||
*/
|
||||
StatusBar.backgroundColorByHexString = function (hexString) { };
|
||||
;
|
||||
/**
|
||||
* Hide the StatusBar
|
||||
*
|
||||
* Options:
|
||||
*
|
||||
* StatusBar.DEFAULT
|
||||
* StatusBar.LIGHT_CONTENT
|
||||
* StatusBar.BLACK_TRANSLUCENT
|
||||
* StatusBar.BLACK_OPAQUE
|
||||
*
|
||||
* @param style the style from above
|
||||
*/
|
||||
StatusBar.hide = function () { };
|
||||
;
|
||||
@ -72,33 +70,60 @@ var StatusBar = (function () {
|
||||
*/
|
||||
StatusBar.show = function () { };
|
||||
;
|
||||
/**
|
||||
* Whether the StatusBar is currently visible or not.
|
||||
*/
|
||||
StatusBar.isVisible = function () {
|
||||
return window.StatusBar.isVisible;
|
||||
};
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "overlaysWebView", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "styleDefault", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "styleLightContent", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "styleBlackTranslucent", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "styleBlackOpaque", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "backgroundColorByName", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "backgroundColorByHexString", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "hide", null);
|
||||
__decorate([
|
||||
plugin_1.Cordova()
|
||||
plugin_1.Cordova({
|
||||
sync: true
|
||||
})
|
||||
], StatusBar, "show", null);
|
||||
__decorate([
|
||||
plugin_1.RequiresPlugin
|
||||
], StatusBar, "isVisible", null);
|
||||
StatusBar = __decorate([
|
||||
plugin_1.Plugin({
|
||||
name: 'StatusBar',
|
||||
|
2
dist/plugins/statusbar.js.map
vendored
2
dist/plugins/statusbar.js.map
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"statusbar.js","sourceRoot":"","sources":["../../src/plugins/statusbar.ts"],"names":["StatusBar","StatusBar.constructor","StatusBar.overlaysWebView","StatusBar.styleDefault","StatusBar.styleLightContent","StatusBar.styleBlackTranslucent","StatusBar.styleBlackOpaque","StatusBar.backgroundColorByName","StatusBar.backgroundColorByHexString","StatusBar.hide","StatusBar.show"],"mappings":";;;;;;AAAA,uBAA8B,UAAU,CAAC,CAAA;AAGzC;;;;;;;;;GASG;AACH;IAAAA;IAoEAC,CAACA;IA9DCD;;;;;OAKGA;IAEIA,yBAAeA,GADtBA,UACuBA,SAAiBA,IAAEE,CAACA;;IAGpCF,sBAAYA,GADnBA,cACsBG,CAACA;;IAGhBH,2BAAiBA,GADxBA,cAC2BI,CAACA;;IAGrBJ,+BAAqBA,GAD5BA,cAC+BK,CAACA;;IAGzBL,0BAAgBA,GADvBA,cAC0BM,CAACA;;IAE3BN;;;;;;;OAOGA;IAEIA,+BAAqBA,GAD5BA,UAC6BA,SAAgBA,IAAEO,CAACA;;IAEhDP;;;;;;OAMGA;IAEIA,oCAA0BA,GADjCA,UACkCA,SAAgBA,IAAEQ,CAACA;;IAErDR;;;;;;;;;;;OAWGA;IAEIA,cAAIA,GADXA,cACcS,CAACA;;IAEfT;;MAEEA;IAEKA,cAAIA,GADXA,cACcU,CAACA;;IAvDfV;QAACA,gBAAOA,EAAEA;OACHA,4BAAeA,QAAqBA;IAE3CA;QAACA,gBAAOA,EAAEA;OACHA,yBAAYA,QAAIA;IAEvBA;QAACA,gBAAOA,EAAEA;OACHA,8BAAiBA,QAAIA;IAE5BA;QAACA,gBAAOA,EAAEA;OACHA,kCAAqBA,QAAIA;IAEhCA;QAACA,gBAAOA,EAAEA;OACHA,6BAAgBA,QAAIA;IAU3BA;QAACA,gBAAOA,EAAEA;OACHA,kCAAqBA,QAAoBA;IAShDA;QAACA,gBAAOA,EAAEA;OACHA,uCAA0BA,QAAoBA;IAcrDA;QAACA,gBAAOA,EAAEA;OACHA,iBAAIA,QAAIA;IAKfA;QAACA,gBAAOA,EAAEA;OACHA,iBAAIA,QAAIA;IAnEjBA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,WAAWA;YACjBA,MAAMA,EAAEA,0BAA0BA;YAClCA,SAASA,EAAEA,WAAWA;SACvBA,CAACA;kBAgEDA;IAADA,gBAACA;AAADA,CAACA,AApED,IAoEC;AA/DY,iBAAS,YA+DrB,CAAA"}
|
||||
{"version":3,"file":"statusbar.js","sourceRoot":"","sources":["../../src/plugins/statusbar.ts"],"names":["StatusBar","StatusBar.constructor","StatusBar.overlaysWebView","StatusBar.styleDefault","StatusBar.styleLightContent","StatusBar.styleBlackTranslucent","StatusBar.styleBlackOpaque","StatusBar.backgroundColorByName","StatusBar.backgroundColorByHexString","StatusBar.hide","StatusBar.show","StatusBar.isVisible"],"mappings":";;;;;;AAAA,uBAA8C,UAAU,CAAC,CAAA;AAIzD;;;;GAIG;AACH;IAAAA;IAiGAC,CAACA;IA3FCD;;;;;OAKGA;IAIIA,yBAAeA,GAHtBA,UAGuBA,WAAoBA,IAAEE,CAACA;;IAE9CF;;OAEGA;IAIIA,sBAAYA,GAHnBA,cAGsBG,CAACA;;IAEvBH;;OAEGA;IAIIA,2BAAiBA,GAHxBA,cAG2BI,CAACA;;IAE5BJ;;OAEGA;IAIIA,+BAAqBA,GAH5BA,cAG+BK,CAACA;;IAEhCL;;OAEGA;IAIIA,0BAAgBA,GAHvBA,cAG0BM,CAACA;;IAE3BN;;;;;;;OAOGA;IAIIA,+BAAqBA,GAH5BA,UAG6BA,SAAiBA,IAAEO,CAACA;;IAEjDP;;;;;;OAMGA;IAIIA,oCAA0BA,GAHjCA,UAGkCA,SAAiBA,IAAEQ,CAACA;;IAEtDR;;OAEGA;IAIIA,cAAIA,GAHXA,cAGcS,CAACA;;IAEfT;;MAEEA;IAIKA,cAAIA,GAHXA,cAGcU,CAACA;;IAEfV;;OAEGA;IAEIA,mBAASA,GADhBA;QAEEW,MAAMA,CAACA,MAAMA,CAACA,SAASA,CAACA,SAASA,CAACA;IACpCA,CAACA;IApFDX;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,4BAAeA,QAAwBA;IAK9CA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,yBAAYA,QAAIA;IAKvBA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,8BAAiBA,QAAIA;IAK5BA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,kCAAqBA,QAAIA;IAKhCA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,6BAAgBA,QAAIA;IAU3BA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,kCAAqBA,QAAqBA;IASjDA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,uCAA0BA,QAAqBA;IAKtDA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,iBAAIA,QAAIA;IAKfA;QAACA,gBAAOA,CAACA;YACPA,IAAIA,EAAEA,IAAIA;SACXA,CAACA;OACKA,iBAAIA,QAAIA;IAKfA;QAACA,uBAAcA;OACRA,sBAASA,QAEfA;IAhGHA;QAACA,eAAMA,CAACA;YACNA,IAAIA,EAAEA,WAAWA;YACjBA,MAAMA,EAAEA,0BAA0BA;YAClCA,SAASA,EAAEA,WAAWA;SACvBA,CAACA;kBA6FDA;IAADA,gBAACA;AAADA,CAACA,AAjGD,IAiGC;AA5FY,iBAAS,YA4FrB,CAAA"}
|
@ -1,15 +1,11 @@
|
||||
import {Plugin, Cordova} from './plugin';
|
||||
import {Plugin, Cordova, RequiresPlugin} from './plugin';
|
||||
|
||||
declare var window;
|
||||
|
||||
/**
|
||||
* Manage the appearance of the native status bar.
|
||||
*
|
||||
* @usage
|
||||
* ```js
|
||||
* StatusBar.hide(); // Hide the bar
|
||||
*
|
||||
* StatusBar.setStyle(StatusBar.LIGHT_CONTENT) // Good for dark backgrounds
|
||||
* ```
|
||||
* Requires Cordova plugin: `cordova-plugin-statusbar`. For more info, please see the [StatusBar plugin docs](https://github.com/apache/cordova-plugin-statusbar).
|
||||
*/
|
||||
@Plugin({
|
||||
name: 'StatusBar',
|
||||
@ -21,21 +17,43 @@ export class StatusBar {
|
||||
* Set whether the status bar overlays the main app view. The default
|
||||
* is true.
|
||||
*
|
||||
* @param doesOverlay whether the status bar overlays the main app view.
|
||||
* @param {boolean} doesOverlay Whether the status bar overlays the main app view.
|
||||
*/
|
||||
@Cordova()
|
||||
static overlaysWebView(doOverlay:boolean){};
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static overlaysWebView(doesOverlay: boolean){};
|
||||
|
||||
@Cordova()
|
||||
/**
|
||||
* Use the default statusbar (dark text, for light backgrounds).
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static styleDefault(){};
|
||||
|
||||
@Cordova()
|
||||
/**
|
||||
* Use the lightContent statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static styleLightContent(){};
|
||||
|
||||
@Cordova()
|
||||
/**
|
||||
* Use the blackTranslucent statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static styleBlackTranslucent(){};
|
||||
|
||||
@Cordova()
|
||||
|
||||
/**
|
||||
* Use the blackOpaque statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static styleBlackOpaque(){};
|
||||
|
||||
/**
|
||||
@ -44,39 +62,46 @@ export class StatusBar {
|
||||
*
|
||||
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing.
|
||||
*
|
||||
* @param name the name of the color (from above)
|
||||
* @param {string} colorName The name of the color (from above)
|
||||
*/
|
||||
@Cordova()
|
||||
static backgroundColorByName(colorName:string){};
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static backgroundColorByName(colorName: string){};
|
||||
|
||||
/**
|
||||
* Set the status bar to a specific hex color (CSS shorthand supported!).
|
||||
*
|
||||
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing.
|
||||
*
|
||||
* @param hex the hex value of the color.
|
||||
* @param {string} hexString The hex value of the color.
|
||||
*/
|
||||
@Cordova()
|
||||
static backgroundColorByHexString(hexString:string){};
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static backgroundColorByHexString(hexString: string){};
|
||||
|
||||
/**
|
||||
* Hide the StatusBar
|
||||
*
|
||||
* Options:
|
||||
*
|
||||
* StatusBar.DEFAULT
|
||||
* StatusBar.LIGHT_CONTENT
|
||||
* StatusBar.BLACK_TRANSLUCENT
|
||||
* StatusBar.BLACK_OPAQUE
|
||||
*
|
||||
* @param style the style from above
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static hide(){};
|
||||
|
||||
/**
|
||||
* Show the StatusBar
|
||||
*/
|
||||
@Cordova()
|
||||
@Cordova({
|
||||
sync: true
|
||||
})
|
||||
static show(){};
|
||||
|
||||
/**
|
||||
* Whether the StatusBar is currently visible or not.
|
||||
*/
|
||||
@RequiresPlugin
|
||||
static isVisible() {
|
||||
return window.StatusBar.isVisible;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user