Compare commits

...
21 Commits
Author SHA1 Message Date
Steve Gill 261f9576fe CB-8858 Updated version in package.json for release 1.0.0 2015-04-15 15:50:47 -07:00
Steve Gill 7c59f7dac6 Revert "CB-8858 Incremented plugin version."
This reverts commit 18e33cafc7.
2015-04-15 14:31:13 -07:00
Steve Gill 18e33cafc7 CB-8858 Incremented plugin version. 2015-04-15 13:55:47 -07:00
Steve Gill aa07a30c3c CB-8858 Updated version and RELEASENOTES.md for release 1.0.0 2015-04-15 11:06:38 -07:00
Steve Gill 07c18077e5 CB-8746 gave plugin major version bump 2015-04-09 17:04:26 -07:00
Steve Gill a4298897b3 CB-8683 changed plugin-id to pacakge-name 2015-04-01 16:44:02 -07:00
Steve Gill 2d25d2ec4c CB-8653 properly updated translated docs to use new id 2015-03-31 16:06:02 -07:00
Steve Gill 56f038efc4 CB-8653 updated translated docs to use new id 2015-03-31 10:53:33 -07:00
Jesse MacFadyen ad786647ff Use TRAVIS_BUILD_DIR, install paramedic by npm 2015-03-24 23:44:27 -07:00
Steve Gill c55bbcc153 CB-8653 Updated Readme 2015-03-13 19:43:44 -07:00
Jesse MacFadyen bf17f43973 Merge branch 'master' of https://github.com/EddyVerbruggen/cordova-plugin-statusbar 2015-03-03 17:28:50 -08:00
Jesse MacFadyen 29b42dd93e CB-8575 Integrate TravisCI 2015-03-02 17:46:03 -08:00
EddyVerbruggen 7f135a46e1 - Use StatusBarBackgroundColor instead of AndroidStatusBarBackgroundColor, and added a quirk to the readme. 2015-02-28 08:59:47 +01:00
EddyVerbruggen 84ee94cb41 - Add support for StatusBar.backgroundColorByHexString (and StatusBar.backgroundColorByName) on Android 5 and up 2015-02-27 22:35:30 +01:00
Victor Sosa b492b1f4b0 CB-8438 cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar 2015-02-27 12:53:05 -06:00
EddyVerbruggen 43c8c15bf4 Allow setting the statusbar backgroundcolor on Android 2015-02-27 10:29:39 +01:00
Steve Gill dff669ece8 CB-8538 Added package.json file 2015-02-25 00:57:45 -08:00
Andrew Grieve 566ecc7923 CB-8429 Incremented plugin version. 2015-02-04 20:54:03 -05:00
Andrew Grieve 5feffc9314 CB-8429 Updated version and RELEASENOTES.md for release 0.1.10 2015-02-04 20:12:45 -05:00
Andrew Grieve cad3a13c37 CB-8351 Use argumentForIndex rather than NSArray extension 2015-01-23 09:49:21 -05:00
Steve Gill eb119e7180 CB-8110 Incremented plugin version. 2014-12-02 16:08:50 -08:00
18 changed files with 618 additions and 339 deletions
+13
View File
@@ -0,0 +1,13 @@
language: objective-c
git:
depth: 2
node_js:
- "0.10"
install:
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- cd ..
- npm install -g cordova-paramedic
- npm install -g cordova
- npm install -g ios-sim
script:
- cordova-paramedic --platform ios --plugin ${TRAVIS_BUILD_DIR}
+277 -2
View File
@@ -17,6 +17,281 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
[![Build Status](https://travis-ci.org/apache/cordova-plugin-statusbar.svg)](https://travis-ci.org/apache/cordova-plugin-statusbar)
StatusBar
======
> The `StatusBar` object provides some functions to customize the iOS and Android StatusBar.
## Installation
cordova plugin add cordova-plugin-statusbar
Preferences
-----------
#### config.xml
- __StatusBarOverlaysWebView__ (boolean, defaults to true). On iOS 7, make the statusbar overlay or not overlay the WebView at startup.
<preference name="StatusBarOverlaysWebView" value="true" />
- __StatusBarBackgroundColor__ (color hex string, defaults to #000000). On iOS 7 and Android 5, set the background color of the statusbar by a hex string (#RRGGBB) at startup.
<preference name="StatusBarBackgroundColor" value="#000000" />
- __StatusBarStyle__ (status bar style, defaults to lightcontent). On iOS 7, set the status bar style. Available options default, lightcontent, blacktranslucent, blackopaque.
<preference name="StatusBarStyle" value="lightcontent" />
### Android Quirks
The Android 5+ guidelines specify using a different color for the statusbar than your main app color (unlike the uniform statusbar color of many iOS 7+ apps), so you may want to set the statusbar color at runtime instead via `StatusBar.backgroundColorByHexString` or `StatusBar.backgroundColorByName`. One way to do that would be:
```js
if (cordova.platformId == 'android') {
StatusBar.backgroundColorByHexString("#333");
}
```
Hiding at startup
-----------
During runtime you can use the StatusBar.hide function below, but if you want the StatusBar to be hidden at app startup, you must modify your app's Info.plist file.
Add/edit these two attributes if not present. Set **"Status bar is initially hidden"** to **"YES"** and set **"View controller-based status bar appearance"** to **"NO"**. If you edit it manually without Xcode, the keys and values are:
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
Methods
-------
This plugin defines global `StatusBar` object.
Although in the global scope, it is not available until after the `deviceready` event.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
- StatusBar.overlaysWebView
- StatusBar.styleDefault
- StatusBar.styleLightContent
- StatusBar.styleBlackTranslucent
- StatusBar.styleBlackOpaque
- StatusBar.backgroundColorByName
- StatusBar.backgroundColorByHexString
- StatusBar.hide
- StatusBar.show
Properties
--------
- StatusBar.isVisible
Permissions
-----------
#### config.xml
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
StatusBar.overlaysWebView
=================
On iOS 7, make the statusbar overlay or not overlay the WebView.
StatusBar.overlaysWebView(true);
Description
-----------
On iOS 7, set to false to make the statusbar appear like iOS 6. Set the style and background color to suit using the other functions.
Supported Platforms
-------------------
- iOS
Quick Example
-------------
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
StatusBar.styleDefault
=================
Use the default statusbar (dark text, for light backgrounds).
StatusBar.styleDefault();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.styleLightContent
=================
Use the lightContent statusbar (light text, for dark backgrounds).
StatusBar.styleLightContent();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.styleBlackTranslucent
=================
Use the blackTranslucent statusbar (light text, for dark backgrounds).
StatusBar.styleBlackTranslucent();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.styleBlackOpaque
=================
Use the blackOpaque statusbar (light text, for dark backgrounds).
StatusBar.styleBlackOpaque();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.backgroundColorByName
=================
On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by color name.
StatusBar.backgroundColorByName("red");
Supported color names are:
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
Supported Platforms
-------------------
- iOS
- Android 5+
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.backgroundColorByHexString
=================
Sets the background color of the statusbar by a hex string.
StatusBar.backgroundColorByHexString("#C0C0C0");
CSS shorthand properties are also supported.
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by a hex string (#RRGGBB).
On WP7 and WP8 you can also specify values as #AARRGGBB, where AA is an alpha value
Supported Platforms
-------------------
- iOS
- Android 5+
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.hide
=================
Hide the statusbar.
StatusBar.hide();
Supported Platforms
-------------------
- iOS
- Android
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.show
=================
Shows the statusbar.
StatusBar.show();
Supported Platforms
-------------------
- iOS
- Android
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.isVisible
=================
Read this property to see if the statusbar is visible or not.
if (StatusBar.isVisible) {
// do something
}
Supported Platforms
-------------------
- iOS
- Android
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
Plugin documentation: [doc/index.md](doc/index.md)
+17
View File
@@ -63,3 +63,20 @@
* CB-7549 - (Re-fix) `StatusBar` **iOS 8** Landscape issue (closes #15)
* CB-7700 cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar
* CB-7571 Bump version of nested plugin to match parent plugin
### 0.1.10 (Feb 04, 2015)
* CB-8351 ios: Use argumentForIndex rather than NSArray extension
### 1.0.0 (Apr 15, 2015)
* CB-8746 gave plugin major version bump
* CB-8683 changed plugin-id to pacakge-name
* CB-8653 properly updated translated docs to use new id
* CB-8653 updated translated docs to use new id
* Use TRAVIS_BUILD_DIR, install paramedic by npm
* CB-8653 Updated Readme
* - Use StatusBarBackgroundColor instead of AndroidStatusBarBackgroundColor, and added a quirk to the readme.
* - Add support for StatusBar.backgroundColorByHexString (and StatusBar.backgroundColorByName) on Android 5 and up
* Allow setting the statusbar backgroundcolor on Android
* CB-8575 Integrate TravisCI
* CB-8438 cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar
* CB-8538 Added package.json file
+26 -2
View File
@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> Das `StatusBar` Objekt stellt einige Funktionen zum Anpassen des iOS und Android StatusBar.
## Installation
cordova plugin add cordova-plugin-statusbar
## "Einstellungen"
#### config.xml
@@ -56,6 +61,16 @@ Diese beiden Attribute hinzufügen/bearbeiten, wenn nicht vorhanden. Legen Sie *
## Methoden
Dieses Plugin wird globales `StatusBar`-Objekt definiert.
Obwohl im globalen Gültigkeitsbereich, steht es nicht bis nach dem `deviceready`-Ereignis.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -112,6 +127,7 @@ Verwenden Sie die Standard-Statusbar (dunkle Text, für helle Hintergründe).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.styleLightContent
@@ -125,6 +141,7 @@ Verwenden Sie die LightContent-Statusbar (heller Text, für dunkle Hintergründe
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +155,7 @@ Verwenden Sie die BlackTranslucent-Statusbar (heller Text, für dunkle Hintergr
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +169,7 @@ Verwenden Sie die BlackOpaque-Statusbar (heller Text, für dunkle Hintergründe)
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.backgroundColorByName
@@ -169,6 +188,7 @@ Unterstützte Farbnamen sind:
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.backgroundColorByHexString
@@ -192,6 +212,7 @@ Auf WP7 und WP8 können Sie auch Werte wie #AARRGGBB, angeben wo AA einen alpha-
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ Ausblenden der Statusleiste.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.show
@@ -220,6 +242,7 @@ Zeigt die Statusleiste.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone-8.1
# StatusBar.isVisible
@@ -235,4 +258,5 @@ Lesen Sie diese Eigenschaft, um festzustellen, ob die Statusbar sichtbar oder ni
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone-8.1
+29 -15
View File
@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> El `StatusBar` objeto proporciona algunas funciones para personalizar el iOS y Android StatusBar.
## Instalación
Cordova plugin agregar cordova-plugin-statusbar
## Preferencias
#### config.xml
@@ -48,14 +53,19 @@ Durante el tiempo de ejecución puede utilizar la función StatusBar.hide abajo,
Agregar/editar estos dos atributos si no está presente. Defina **"inicialmente se esconde la barra de estado"** a **"YES"** y **"Aparición de vista basado en controlador estatus bar"** a **"NO"**. Si se edita manualmente sin Xcode, las claves y valores son:
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
< llave > UIStatusBarHidden < / key >< verdadero / >< llave > UIViewControllerBasedStatusBarAppearance < / key >< falso / >
## Métodos
Este plugin define global `StatusBar` objeto.
Aunque en el ámbito global, no estará disponible hasta después de la `deviceready` evento.
document.addEventListener ("deviceready", onDeviceReady, false);
function onDeviceReady() {console.log(StatusBar)};
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -74,9 +84,7 @@ Agregar/editar estos dos atributos si no está presente. Defina **"inicialmente
#### config.xml
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
< nombre de la función = "StatusBar" >< nombre param = "ios-paquete" value = "CDVStatusBar" onload = "true" / >< / característica >
# StatusBar.overlaysWebView
@@ -112,6 +120,7 @@ Utilice la barra de estado por defecto (texto oscuro, para fondos de luz).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
@@ -125,6 +134,7 @@ Utilice la barra de estado lightContent (texto ligero, para fondos oscuros).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +148,7 @@ Utilice la barra de estado blackTranslucent (texto ligero, para fondos oscuros).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +162,7 @@ Utilice la barra de estado blackOpaque (texto ligero, para fondos oscuros).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
@@ -161,7 +173,7 @@ En iOS 7, al establecer StatusBar.statusBarOverlaysWebView a false, se puede est
Nombres de los colores admitidos son:
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
negro, gris oscuro, lightGray, blanco, gris, rojo, verde, azul, cian, amarillo, magenta, naranja, púrpura, marrón
## Plataformas soportadas
@@ -169,6 +181,7 @@ Nombres de los colores admitidos son:
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -179,8 +192,7 @@ Establece el color de fondo de la barra de estado por una cadena hexadecimal.
Propiedades CSS abreviada también son compatibles.
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
StatusBar.backgroundColorByHexString("#333"); = > StatusBar.backgroundColorByHexString("#FAB") #333333; = > #FFAABB
En iOS 7, cuando se establece StatusBar.statusBarOverlaysWebView en false, se puede establecer el color de fondo de la barra de estado una cadena hexadecimal (#RRGGBB).
@@ -192,6 +204,7 @@ En WP7 y WP8 también puede especificar valores como #AARRGGBB, donde AA es un v
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +219,7 @@ Ocultar la barra de estado.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,14 +234,13 @@ Muestra la barra de estado.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
Lea esta propiedad para ver si la barra de estado es visible o no.
if (StatusBar.isVisible) {
// do something
}
Si (StatusBar.isVisible) {/ / hacer algo}
## Plataformas soportadas
@@ -235,4 +248,5 @@ Lea esta propiedad para ver si la barra de estado es visible o no.
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1
+30 -6
View File
@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> Le `StatusBar` objet fournit quelques fonctions pour personnaliser les iOS et Android StatusBar.
## Installation
cordova plugin add cordova-plugin-statusbar
## Préférences
#### config.xml
@@ -56,6 +61,16 @@ Ajouter/modifier ces deux attributs si n'est pas présent. **"Barre d'État est
## Méthodes
Ce plugin définit objet `StatusBar` global.
Bien que dans la portée globale, il n'est pas disponible jusqu'après la `deviceready` événement.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -90,11 +105,11 @@ Sur iOS 7, faire la statusbar superposition ou pas superposer le WebView.
Sur iOS 7, la valeur false pour afficher la barre d'État comme iOS 6. Définissez la couleur de style et d'arrière-plan en fonction de l'utilisation des autres fonctions.
## Plates-formes prises en charge
## Plates-formes supportées
* iOS
## Petit exemple
## Exemple court
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
@@ -104,7 +119,7 @@ Sur iOS 7, la valeur false pour afficher la barre d'État comme iOS 6. Définiss
Utilisez la barre de statut par défaut (texte sombre, pour les arrière-plans lumineux).
StatusBar.styleDefault() ;
StatusBar.styleDefault();
## Plates-formes prises en charge
@@ -112,6 +127,7 @@ Utilisez la barre de statut par défaut (texte sombre, pour les arrière-plans l
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
@@ -125,6 +141,7 @@ Utilisez la barre d'État lightContent (texte clair, des arrière-plans sombres)
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +155,7 @@ Utilisez la barre d'État blackTranslucent (texte clair, des arrière-plans somb
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +169,7 @@ Utilisez la barre d'État blackOpaque (texte clair, des arrière-plans sombres).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
@@ -169,6 +188,7 @@ Les noms de couleurs prises en charge sont :
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -192,6 +212,7 @@ Sur WP7 et WP8, vous pouvez également spécifier des valeurs comme #AARRGGBB, o
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ Masquer la barre d'État.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,6 +242,7 @@ Affiche la barre d'État.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
@@ -230,9 +253,10 @@ Lire cette propriété afin de voir si la barre d'État est visible ou non.
}
## Plates-formes prises en charge
## Plates-formes supportées
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1
-284
View File
@@ -1,284 +0,0 @@
<!---
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
# org.apache.cordova.statusbar
StatusBar
======
> The `StatusBar` object provides some functions to customize the iOS and Android StatusBar.
## Installation
cordova plugin add org.apache.cordova.statusbar
Preferences
-----------
#### config.xml
- __StatusBarOverlaysWebView__ (boolean, defaults to true). On iOS 7, make the statusbar overlay or not overlay the WebView at startup.
<preference name="StatusBarOverlaysWebView" value="true" />
- __StatusBarBackgroundColor__ (color hex string, defaults to #000000). On iOS 7, set the background color of the statusbar by a hex string (#RRGGBB) at startup.
<preference name="StatusBarBackgroundColor" value="#000000" />
- __StatusBarStyle__ (status bar style, defaults to lightcontent). On iOS 7, set the status bar style. Available options default, lightcontent, blacktranslucent, blackopaque.
<preference name="StatusBarStyle" value="lightcontent" />
Hiding at startup
-----------
During runtime you can use the StatusBar.hide function below, but if you want the StatusBar to be hidden at app startup, you must modify your app's Info.plist file.
Add/edit these two attributes if not present. Set **"Status bar is initially hidden"** to **"YES"** and set **"View controller-based status bar appearance"** to **"NO"**. If you edit it manually without Xcode, the keys and values are:
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
Methods
-------
This plugin defines global `StatusBar` object.
Although in the global scope, it is not available until after the `deviceready` event.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
- StatusBar.overlaysWebView
- StatusBar.styleDefault
- StatusBar.styleLightContent
- StatusBar.styleBlackTranslucent
- StatusBar.styleBlackOpaque
- StatusBar.backgroundColorByName
- StatusBar.backgroundColorByHexString
- StatusBar.hide
- StatusBar.show
Properties
--------
- StatusBar.isVisible
Permissions
-----------
#### config.xml
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
StatusBar.overlaysWebView
=================
On iOS 7, make the statusbar overlay or not overlay the WebView.
StatusBar.overlaysWebView(true);
Description
-----------
On iOS 7, set to false to make the statusbar appear like iOS 6. Set the style and background color to suit using the other functions.
Supported Platforms
-------------------
- iOS
Quick Example
-------------
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
StatusBar.styleDefault
=================
Use the default statusbar (dark text, for light backgrounds).
StatusBar.styleDefault();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.styleLightContent
=================
Use the lightContent statusbar (light text, for dark backgrounds).
StatusBar.styleLightContent();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.styleBlackTranslucent
=================
Use the blackTranslucent statusbar (light text, for dark backgrounds).
StatusBar.styleBlackTranslucent();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.styleBlackOpaque
=================
Use the blackOpaque statusbar (light text, for dark backgrounds).
StatusBar.styleBlackOpaque();
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.backgroundColorByName
=================
On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by color name.
StatusBar.backgroundColorByName("red");
Supported color names are:
black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.backgroundColorByHexString
=================
Sets the background color of the statusbar by a hex string.
StatusBar.backgroundColorByHexString("#C0C0C0");
CSS shorthand properties are also supported.
StatusBar.backgroundColorByHexString("#333"); // => #333333
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by a hex string (#RRGGBB).
On WP7 and WP8 you can also specify values as #AARRGGBB, where AA is an alpha value
Supported Platforms
-------------------
- iOS
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.hide
=================
Hide the statusbar.
StatusBar.hide();
Supported Platforms
-------------------
- iOS
- Android
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.show
=================
Shows the statusbar.
StatusBar.show();
Supported Platforms
-------------------
- iOS
- Android
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
StatusBar.isVisible
=================
Read this property to see if the statusbar is visible or not.
if (StatusBar.isVisible) {
// do something
}
Supported Platforms
-------------------
- iOS
- Android
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
+26 -2
View File
@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> Il `StatusBar` oggetto fornisce alcune funzioni per personalizzare l'iOS e Android StatusBar.
## Installazione
cordova plugin add cordova-plugin-statusbar
## Preferenze
#### config.xml
@@ -56,6 +61,16 @@ Aggiungere o modificare questi due attributi, se non presente. Impostare la **"b
## Metodi
Questo plugin definisce globale oggetto `StatusBar`.
Anche se in ambito globale, non è disponibile fino a dopo l'evento `deviceready`.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -112,6 +127,7 @@ Utilizzare la barra di stato predefinito (testo scuro, per sfondi di luce).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
@@ -125,6 +141,7 @@ Utilizzare la barra di stato lightContent (testo in chiaro, per sfondi scuri).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +155,7 @@ Utilizzare la barra di stato blackTranslucent (testo in chiaro, per sfondi scuri
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +169,7 @@ Utilizzare la barra di stato blackOpaque (testo in chiaro, per sfondi scuri).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
@@ -169,6 +188,7 @@ Nomi di colore supportati sono:
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -192,6 +212,7 @@ Su WP7 e WP8 è inoltre possibile specificare i valori come #AARRGGBB, dove AA
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ Nascondere la barra di stato.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,6 +242,7 @@ Mostra la barra di stato.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
@@ -235,4 +258,5 @@ Leggere questa proprietà per vedere se la barra di stato è visibile o no.
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1
+27 -3
View File
@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> `StatusBar`オブジェクトは、iOS と Android ステータス バーをカスタマイズするいくつかの機能を提供します。
## インストール
cordova plugin add cordova-plugin-statusbar
## 基本設定
#### config.xml
@@ -56,6 +61,16 @@
## メソッド
このプラグインでは、グローバル `StatusBar` オブジェクトを定義します。
グローバル スコープではあるがそれがないまで `deviceready` イベントの後です。
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -86,7 +101,7 @@ IOS 7、statusbar オーバーレイまたはない WebView をオーバーレ
StatusBar.overlaysWebView(true);
## 説
##
IOS 7、iOS の 6 のように表示されるステータスバーを false に設定します。他の関数の使用に合わせてスタイルや背景色を設定します。
@@ -112,6 +127,7 @@ IOS 7、iOS の 6 のように表示されるステータスバーを false に
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
@@ -125,6 +141,7 @@ LightContent ステータスバー (暗い背景の明るいテキスト) を
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +155,7 @@ BlackTranslucent ステータスバー (暗い背景の明るいテキスト)
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +169,7 @@ BlackOpaque ステータスバー (暗い背景の明るいテキスト) を
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
@@ -169,6 +188,7 @@ Ios 7、StatusBar.statusBarOverlaysWebView を false に設定する場合はス
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -192,6 +212,7 @@ WP7 と WP8 も指定できます値 #AARRGGBB, AA は、アルファ値とし
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ WP7 と WP8 も指定できます値 #AARRGGBB, AA は、アルファ値とし
* アンドロイド
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,6 +242,7 @@ WP7 と WP8 も指定できます値 #AARRGGBB, AA は、アルファ値とし
* アンドロイド
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
@@ -235,4 +258,5 @@ WP7 と WP8 も指定できます値 #AARRGGBB, AA は、アルファ値とし
* iOS
* アンドロイド
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1
+26 -2
View File
@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> `StatusBar`개체 iOS와 안 드 로이드 상태 표시줄을 사용자 지정 하려면 몇 가지 기능을 제공 합니다.
## 설치
cordova plugin add cordova-plugin-statusbar
## 환경 설정
#### config.xml
@@ -56,6 +61,16 @@
## 메서드
이 플러그인 글로벌 `StatusBar` 개체를 정의합니다.
전역 범위에 있지만 그것은 불가능까지 `deviceready` 이벤트 후.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -112,6 +127,7 @@ IOS 7, 오버레이 또는 하지 WebView 중첩 상태 표시줄을 확인 합
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
@@ -125,6 +141,7 @@ LightContent 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스트)
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +155,7 @@ BlackTranslucent 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +169,7 @@ BlackOpaque 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스트)
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
@@ -169,6 +188,7 @@ Ios 7, StatusBar.statusBarOverlaysWebView을 false로 설정 하면 설정할
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -192,6 +212,7 @@ WP7 및 WP8에 당신은 또한 #AARRGGBB, AA는 알파 값으로 값을 지정
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ WP7 및 WP8에 당신은 또한 #AARRGGBB, AA는 알파 값으로 값을 지정
* 안 드 로이드
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,6 +242,7 @@ WP7 및 WP8에 당신은 또한 #AARRGGBB, AA는 알파 값으로 값을 지정
* 안 드 로이드
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
@@ -235,4 +258,5 @@ WP7 및 WP8에 당신은 또한 #AARRGGBB, AA는 알파 값으로 값을 지정
* iOS
* 안 드 로이드
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1
+26 -2
View File
@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> `StatusBar`Obiekt zawiera kilka funkcji, aby dostosować iOS i Android StatusBar.
## Instalacja
cordova plugin add cordova-plugin-statusbar
## Preferencje
#### config.xml
@@ -56,6 +61,16 @@ Dodawanie/edycja tych dwóch atrybutów jeśli nie obecny. Ustawianie **"pasek s
## Metody
Ten plugin definiuje obiekt globalny `StatusBar`.
Chociaż w globalnym zasięgu, to nie dostępne dopiero po `deviceready` imprezie.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -112,6 +127,7 @@ Użyj domyślnego stanu (ciemny tekst, teł światła).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
@@ -125,6 +141,7 @@ Użyj lightContent stanu (światło tekst, ciemne tło).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
@@ -138,6 +155,7 @@ Użyj blackTranslucent stanu (światło tekst, ciemne tło).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
@@ -151,6 +169,7 @@ Użyj blackOpaque stanu (światło tekst, ciemne tło).
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
@@ -169,6 +188,7 @@ Nazwy kolorów obsługiwane są:
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -192,6 +212,7 @@ Na WP7 i WP8 można również określić wartości jako #AARRGGBB, gdzie AA jest
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ Ukryj pasek stanu.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,6 +242,7 @@ Pokazuje pasek stanu.
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
@@ -235,4 +258,5 @@ Czytać tej właściwość, aby sprawdzić, czy stanu jest widoczne lub nie.
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1
+2 -2
View File
@@ -17,7 +17,7 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
@@ -235,4 +235,4 @@
* iOS
* Android
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
+35 -11
View File
@@ -17,12 +17,17 @@
under the License.
-->
# org.apache.cordova.statusbar
# cordova-plugin-statusbar
# StatusBar
> `StatusBar`物件提供了一些功能,自訂的 iOS 和 Android 狀態列。
## 安裝
cordova plugin add cordova-plugin-statusbar
## 首選項
#### config.xml
@@ -56,6 +61,16 @@
## 方法
這個外掛程式定義全域 `StatusBar` 物件。
雖然在全球範圍內,它不可用直到 `deviceready` 事件之後。
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(StatusBar);
}
* StatusBar.overlaysWebView
* StatusBar.styleDefault
* StatusBar.styleLightContent
@@ -86,9 +101,9 @@
StatusBar.overlaysWebView(true);
## 描述
## 說明
在 iOS 7,設置為 false,使狀態列出現像 iOS 6。設置樣式和背景顏色,以適應使用其他函數。
在 iOS 7,設置為 false,使狀態列出現像 iOS 6。設置樣式和背景顏色,適合使用其他函數。
## 支援的平臺
@@ -104,7 +119,7 @@
使用預設狀態列 (淺色背景深色文本)。
StatusBar.styleDefault()
StatusBar.styleDefault();
## 支援的平臺
@@ -112,10 +127,11 @@
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleLightContent
使用 lightContent 狀態列 光文本,為深色背景)。
使用 lightContent 狀態列 (深色背景光文本)。
StatusBar.styleLightContent();
@@ -125,10 +141,11 @@
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackTranslucent
使用 blackTranslucent 狀態列 光文本,為深色背景)。
使用 blackTranslucent 狀態列 (深色背景光文本)。
StatusBar.styleBlackTranslucent();
@@ -138,10 +155,11 @@
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.styleBlackOpaque
使用 blackOpaque 狀態列 光文本,為深色背景)。
使用 blackOpaque 狀態列 (深色背景光文本)。
StatusBar.styleBlackOpaque();
@@ -151,10 +169,11 @@
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByName
在 iOS 7,當將 StatusBar.statusBarOverlaysWebView 設置為 false,你可以設置狀態列的背景顏色由顏色名稱。
在 iOS 7,當將 StatusBar.statusBarOverlaysWebView 設置為 false,你可以設置狀態列的背景色的顏色名稱。
StatusBar.backgroundColorByName("red");
@@ -169,6 +188,7 @@
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.backgroundColorByHexString
@@ -183,7 +203,7 @@
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
在 iOS 7,當將 StatusBar.statusBarOverlaysWebView 設置為 false可以設置狀態列的背景色由十六進位字串 #RRGGBB)。
在 iOS 7,當將 StatusBar.statusBarOverlaysWebView 設置為 false可以設置狀態列的背景色由十六進位字串 (#RRGGBB)。
WP7 和 WP8 您還可以指定值為 #AARRGGBB,其中 AA 是 Alpha 值
@@ -192,6 +212,7 @@ WP7 和 WP8 您還可以指定值為 #AARRGGBB,其中 AA 是 Alpha 值
* iOS
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.hide
@@ -206,6 +227,7 @@ WP7 和 WP8 您還可以指定值為 #AARRGGBB,其中 AA 是 Alpha 值
* 安卓系統
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.show
@@ -220,10 +242,11 @@ WP7 和 WP8 您還可以指定值為 #AARRGGBB,其中 AA 是 Alpha 值
* 安卓系統
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8.1
# StatusBar.isVisible
讀取此屬性,以看看是否狀態列是可見的或不
讀取此屬性,以看狀態列是可見。
if (StatusBar.isVisible) {
// do something
@@ -235,4 +258,5 @@ WP7 和 WP8 您還可以指定值為 #AARRGGBB,其中 AA 是 Alpha 值
* iOS
* 安卓系統
* Windows Phone 7
* Windows Phone 8
* Windows Phone 8
* Windows Phone 8.1
+37
View File
@@ -0,0 +1,37 @@
{
"name": "cordova-plugin-statusbar",
"version": "1.0.0",
"description": "Cordova StatusBar Plugin",
"cordova": {
"id": "cordova-plugin-statusbar",
"platforms": [
"android",
"ios",
"wp7",
"wp8",
"windows"
]
},
"repository": {
"type": "git",
"url": "https://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar.git"
},
"keywords": [
"cordova",
"statusbar",
"ecosystem:cordova",
"cordova-android",
"cordova-ios",
"cordova-wp7",
"cordova-wp8",
"cordova-windows"
],
"engines": [
{
"name": "cordova",
"version": ">=3.0.0"
}
],
"author": "Apache Software Foundation",
"license": "Apache 2.0"
}
+2 -2
View File
@@ -21,8 +21,8 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
id="org.apache.cordova.statusbar"
version="0.1.9">
id="cordova-plugin-statusbar"
version="1.0.0">
<name>StatusBar</name>
<description>Cordova StatusBar Plugin</description>
<license>Apache 2.0</license>
+40 -1
View File
@@ -20,6 +20,8 @@
package org.apache.cordova.statusbar;
import android.app.Activity;
import android.graphics.Color;
import android.os.Build;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
@@ -54,6 +56,9 @@ public class StatusBar extends CordovaPlugin {
// by the Cordova.
Window window = cordova.getActivity().getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
// Read 'StatusBarBackgroundColor' from config.xml, default is #000000.
setStatusBarBackgroundColor(preferences.getString("StatusBarBackgroundColor", "#000000"));
}
});
}
@@ -67,7 +72,7 @@ public class StatusBar extends CordovaPlugin {
* @return True if the action was valid, false otherwise.
*/
@Override
public boolean execute(String action, CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
public boolean execute(final String action, final CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
Log.v(TAG, "Executing action: " + action);
final Activity activity = this.cordova.getActivity();
final Window window = activity.getWindow();
@@ -96,6 +101,40 @@ public class StatusBar extends CordovaPlugin {
return true;
}
if ("backgroundColorByHexString".equals(action)) {
this.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
try {
setStatusBarBackgroundColor(args.getString(0));
} catch (JSONException ignore) {
Log.e(TAG, "Invalid hexString argument, use f.i. '#777777'");
}
}
});
return true;
}
return false;
}
private void setStatusBarBackgroundColor(final String colorPref) {
if (Build.VERSION.SDK_INT >= 21) {
if (colorPref != null && !colorPref.isEmpty()) {
final Window window = cordova.getActivity().getWindow();
// Method and constants not available on all SDKs but we want to be able to compile this code with any SDK
window.clearFlags(0x04000000); // SDK 19: WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(0x80000000); // SDK 21: WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
try {
// Using reflection makes sure any 5.0+ device will work without having to compile with SDK level 21
window.getClass().getDeclaredMethod("setStatusBarColor", int.class).invoke(window, Color.parseColor(colorPref));
} catch (IllegalArgumentException ignore) {
Log.e(TAG, "Invalid hexString argument, use f.i. '#999999'");
} catch (Exception ignore) {
// this should not happen, only in case Android removes this method in a version > 21
Log.w(TAG, "Method window.setStatusBarColor not found for SDK level " + Build.VERSION.SDK_INT);
}
}
}
}
}
+3 -3
View File
@@ -232,7 +232,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
- (void) overlaysWebView:(CDVInvokedUrlCommand*)command
{
id value = [command.arguments objectAtIndex:0];
id value = [command argumentAtIndex:0];
if (!([value isKindOfClass:[NSNumber class]])) {
value = [NSNumber numberWithBool:YES];
}
@@ -301,7 +301,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
- (void) backgroundColorByName:(CDVInvokedUrlCommand*)command
{
id value = [command.arguments objectAtIndex:0];
id value = [command argumentAtIndex:0];
if (!([value isKindOfClass:[NSString class]])) {
value = @"black";
}
@@ -325,7 +325,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
- (void) backgroundColorByHexString:(CDVInvokedUrlCommand*)command
{
NSString* value = [command.arguments objectAtIndex:0];
NSString* value = [command argumentAtIndex:0];
if (!([value isKindOfClass:[NSString class]])) {
value = @"#000000";
}
+2 -2
View File
@@ -21,8 +21,8 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
id="org.apache.cordova.statusbar.tests"
version="0.1.9">
id="cordova-plugin-statusbar-tests"
version="1.0.0">
<name>Cordova StatusBar Plugin Tests</name>
<license>Apache 2.0</license>