Removed statusBar prefix from StatusBar plugin API

This commit is contained in:
Shazron Abdullah 2013-10-07 17:20:36 -07:00
parent b61eaae310
commit 4be7bcc826
4 changed files with 26 additions and 26 deletions

View File

@ -10,13 +10,13 @@ For iOS 7, to use the statusbar style functions, you need the addition of a key
Methods
-------
- StatusBar.statusBarOverlaysWebView
- StatusBar.overlaysWebView
- StatusBar.styleDefault
- StatusBar.styleLightContent
- StatusBar.styleBlackTranslucent
- StatusBar.styleBlackOpaque
- StatusBar.statusBarBackgroundColorByName
- StatusBar.statusBarBackgroundColorByHexString
- StatusBar.backgroundColorByName
- StatusBar.backgroundColorByHexString
Properties
--------
@ -37,12 +37,12 @@ Permissions
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
StatusBar.statusBarOverlaysWebView
StatusBar.overlaysWebView
=================
On iOS 7, make the statusbar overlay or not overlay the WebView.
StatusBar.statusBarOverlaysWebView(true);
StatusBar.overlaysWebView(true);
Description
-----------
@ -58,8 +58,8 @@ Supported Platforms
Quick Example
-------------
StatusBar.statusBarOverlaysWebView(true);
StatusBar.statusBarOverlaysWebView(false);
StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
StatusBar.styleDefault
=================
@ -114,12 +114,12 @@ Supported Platforms
- iOS
StatusBar.statusBarBackgroundColorByName
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.statusBarBackgroundColorByName("red");
StatusBar.backgroundColorByName("red");
Supported color names are:
@ -131,12 +131,12 @@ Supported Platforms
- iOS
StatusBar.statusBarBackgroundColorByHexString
StatusBar.backgroundColorByHexString
=================
On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by a hex string (#RRGGBB).
StatusBar.statusBarBackgroundColorByHexString("#C0C0C0");
StatusBar.backgroundColorByHexString("#C0C0C0");
Supported Platforms

View File

@ -29,14 +29,14 @@
@property (atomic, assign) BOOL statusBarOverlaysWebView;
- (void) statusBarOverlaysWebView:(CDVInvokedUrlCommand*)command;
- (void) overlaysWebView:(CDVInvokedUrlCommand*)command;
- (void) styleDefault:(CDVInvokedUrlCommand*)command;
- (void) styleLightContent:(CDVInvokedUrlCommand*)command;
- (void) styleBlackTranslucent:(CDVInvokedUrlCommand*)command;
- (void) styleBlackOpaque:(CDVInvokedUrlCommand*)command;
- (void) statusBarBackgroundColorByName:(CDVInvokedUrlCommand*)command;
- (void) statusBarBackgroundColorByHexString:(CDVInvokedUrlCommand*)command;
- (void) backgroundColorByName:(CDVInvokedUrlCommand*)command;
- (void) backgroundColorByHexString:(CDVInvokedUrlCommand*)command;
@end

View File

@ -61,7 +61,7 @@
setting = @"StatusBarBackgroundColor";
if ([self settingForKey:setting]) {
[self _statusBarBackgroundColorByHexString:[self settingForKey:setting]];
[self _backgroundColorByHexString:[self settingForKey:setting]];
}
}
@ -97,7 +97,7 @@
return _statusBarOverlaysWebView;
}
- (void) statusBarOverlaysWebView:(CDVInvokedUrlCommand*)command
- (void) overlaysWebView:(CDVInvokedUrlCommand*)command
{
id value = [command.arguments objectAtIndex:0];
if (!([value isKindOfClass:[NSNumber class]])) {
@ -147,7 +147,7 @@
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque];
}
- (void) statusBarBackgroundColorByName:(CDVInvokedUrlCommand*)command
- (void) backgroundColorByName:(CDVInvokedUrlCommand*)command
{
id value = [command.arguments objectAtIndex:0];
if (!([value isKindOfClass:[NSString class]])) {
@ -160,7 +160,7 @@
}
}
- (void) _statusBarBackgroundColorByHexString:(NSString*)hexString
- (void) _backgroundColorByHexString:(NSString*)hexString
{
unsigned int rgbValue = 0;
NSScanner* scanner = [NSScanner scannerWithString:hexString];
@ -170,7 +170,7 @@
_statusBarBackgroundView.backgroundColor = [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:1.0];
}
- (void) statusBarBackgroundColorByHexString:(CDVInvokedUrlCommand*)command
- (void) backgroundColorByHexString:(CDVInvokedUrlCommand*)command
{
NSString* value = [command.arguments objectAtIndex:0];
if (!([value isKindOfClass:[NSString class]])) {
@ -181,7 +181,7 @@
return;
}
[self _statusBarBackgroundColorByHexString:value];
[self _backgroundColorByHexString:value];
}

View File

@ -26,8 +26,8 @@ var argscheck = require('cordova/argscheck'),
var StatusBar = function() {
};
StatusBar.statusBarOverlaysWebView = function(doOverlay) {
exec(null, null, "StatusBar", "statusBarOverlaysWebView", [doOverlay]);
StatusBar.overlaysWebView = function(doOverlay) {
exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]);
};
StatusBar.styleDefault = function() {
@ -46,12 +46,12 @@ StatusBar.styleBlackOpaque = function() {
exec(null, null, "StatusBar", "styleBlackOpaque", []);
};
StatusBar.statusBarBackgroundColorByName = function(colorname) {
exec(null, null, "StatusBar", "statusBarBackgroundColorByName", [colorname]);
StatusBar.backgroundColorByName = function(colorname) {
exec(null, null, "StatusBar", "backgroundColorByName", [colorname]);
}
StatusBar.statusBarBackgroundColorByHexString = function(hexString) {
exec(null, null, "StatusBar", "statusBarBackgroundColorByHexString", [hexString]);
StatusBar.backgroundColorByHexString = function(hexString) {
exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]);
}
// TODO: