Skip to content

Commit 053a902

Browse files
authored
Merge pull request #97 from Menardi/Menardi-patch-1
Add Android overlay support to README
2 parents b8e0b01 + e0256b2 commit 053a902

1 file changed

Lines changed: 25 additions & 16 deletions

File tree

README.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,34 +53,42 @@ Preferences
5353

5454
#### config.xml
5555

56-
- __StatusBarOverlaysWebView__ (boolean, defaults to true). On iOS 7, make the statusbar overlay or not overlay the WebView at startup.
56+
- __StatusBarOverlaysWebView__ (boolean, defaults to true). On iOS, make the statusbar overlay or not overlay the WebView at startup.
5757

5858
<preference name="StatusBarOverlaysWebView" value="true" />
5959

60-
- __StatusBarBackgroundColor__ (color hex string, no default value). On iOS 7, set the background color of the statusbar by a hex string (#RRGGBB) at startup. If this value is not set, the background color will be transparent.
60+
- __StatusBarBackgroundColor__ (color hex string, no default value). On iOS, set the background color of the statusbar by a hex string (#RRGGBB) at startup. If this value is not set, the background color will be transparent.
6161

6262
<preference name="StatusBarBackgroundColor" value="#000000" />
6363

64-
- __StatusBarStyle__ (status bar style, defaults to lightcontent). On iOS 7, set the status bar style. Available options default, lightcontent, blacktranslucent, blackopaque.
64+
- __StatusBarStyle__ (status bar style, defaults to lightcontent). On iOS, set the status bar style. Available options default, lightcontent, blacktranslucent, blackopaque.
6565

6666
<preference name="StatusBarStyle" value="lightcontent" />
6767

68-
- __StatusBarDefaultScrollToTop__ (boolean, defaults to false). On iOS 7, allows the Cordova WebView to use default scroll-to-top behavior. Defaults to false so you can listen to the "statusTap" event (described below) and customize the behavior instead.
68+
- __StatusBarDefaultScrollToTop__ (boolean, defaults to false). On iOS, allows the Cordova WebView to use default scroll-to-top behavior. Defaults to false so you can listen to the "statusTap" event (described below) and customize the behavior instead.
6969

7070
<preference name="StatusBarDefaultScrollToTop" value="false" />
7171

7272
### Android Quirks
73-
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:
73+
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 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:
7474
```js
7575
if (cordova.platformId == 'android') {
7676
StatusBar.backgroundColorByHexString("#333");
7777
}
7878
```
7979

80+
It is also possible to make the status bar semi-transparent. For example, a black status bar with 20% opacity:
81+
```js
82+
if (cordova.platformId == 'android') {
83+
StatusBar.overlaysWebView(true);
84+
StatusBar.backgroundColorByHexString('#33000000');
85+
}
86+
```
87+
8088
Hiding at startup
8189
-----------
8290

83-
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.
91+
During runtime you can use the StatusBar.hide function below, but if you want the StatusBar to be hidden at app startup on iOS, you must modify your app's Info.plist file.
8492

8593
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:
8694

@@ -125,20 +133,21 @@ Events
125133
StatusBar.overlaysWebView
126134
=================
127135

128-
On iOS 7, make the statusbar overlay or not overlay the WebView.
136+
Make the statusbar overlay or not overlay the WebView.
129137

130138
StatusBar.overlaysWebView(true);
131139

132140
Description
133141
-----------
134142

135-
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.
143+
Set to true to make the statusbar overlay on top of your app. Ensure that you adjust your styling accordingly so that your app's title bar or content is not covered. Set to false to make the statusbar solid and not overlay your app. You can then set the style and background color to suit using the other functions.
136144

137145

138146
Supported Platforms
139147
-------------------
140148

141-
- iOS
149+
- iOS 7+
150+
- Android 5+
142151

143152
Quick Example
144153
-------------
@@ -158,7 +167,7 @@ Supported Platforms
158167
-------------------
159168

160169
- iOS
161-
- Android 6+
170+
- Android 6+
162171
- Windows Phone 7
163172
- Windows Phone 8
164173
- Windows Phone 8.1
@@ -175,7 +184,7 @@ Supported Platforms
175184
-------------------
176185

177186
- iOS
178-
- Android 6+
187+
- Android 6+
179188
- Windows Phone 7
180189
- Windows Phone 8
181190
- Windows Phone 8.1
@@ -192,7 +201,7 @@ Supported Platforms
192201
-------------------
193202

194203
- iOS
195-
- Android 6+
204+
- Android 6+
196205
- Windows Phone 7
197206
- Windows Phone 8
198207
- Windows Phone 8.1
@@ -209,7 +218,7 @@ Supported Platforms
209218
-------------------
210219

211220
- iOS
212-
- Android 6+
221+
- Android 6+
213222
- Windows Phone 7
214223
- Windows Phone 8
215224
- Windows Phone 8.1
@@ -218,7 +227,7 @@ Supported Platforms
218227
StatusBar.backgroundColorByName
219228
=================
220229

221-
On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by color name.
230+
On iOS, when you set StatusBar.overlaysWebView to false, you can set the background color of the statusbar by color name.
222231

223232
StatusBar.backgroundColorByName("red");
224233

@@ -248,9 +257,9 @@ CSS shorthand properties are also supported.
248257
StatusBar.backgroundColorByHexString("#333"); // => #333333
249258
StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
250259

251-
On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by a hex string (#RRGGBB).
260+
On iOS, when you set StatusBar.overlaysWebView to false, you can set the background color of the statusbar by a hex string (#RRGGBB).
252261

253-
On WP7 and WP8 you can also specify values as #AARRGGBB, where AA is an alpha value
262+
On Android, when StatusBar.overlaysWebView is true, and on WP7&8, you can also specify values as #AARRGGBB, where AA is an alpha value.
254263

255264
Supported Platforms
256265
-------------------

0 commit comments

Comments
 (0)