Compare commits

...
5 Commits
7 changed files with 43 additions and 8 deletions
+5
View File
@@ -20,6 +20,11 @@
-->
# Release Notes
### 2.1.0 (Jan 15, 2016)
* CB-9513 Allow to show/hide status bar in fullscreen mode.
* CB-8720 Fix status bar position when app started upside down on **iOS 7**.
* CB-10118 Fixes plugin loading error for **Browser** platform
### 2.0.0 (Nov 18, 2015)
* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
* Added `weakSelf` reference for block use
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-statusbar",
"version": "2.0.0",
"version": "2.1.0",
"description": "Cordova StatusBar Plugin",
"cordova": {
"id": "cordova-plugin-statusbar",
+2 -2
View File
@@ -22,7 +22,7 @@
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-statusbar"
version="2.0.0">
version="2.1.0">
<name>StatusBar</name>
<description>Cordova StatusBar Plugin</description>
<license>Apache 2.0</license>
@@ -48,7 +48,7 @@
</platform>
<platform name="browser">
<js-module src="src/browser/statusbar.js" name="statusbar">
<js-module src="src/browser/statusbar.js" name="statusbar.Browser">
<merges target="window.StatusBar" />
</js-module>
</platform>
+24
View File
@@ -23,6 +23,7 @@ import android.app.Activity;
import android.graphics.Color;
import android.os.Build;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
@@ -76,6 +77,7 @@ public class StatusBar extends CordovaPlugin {
Log.v(TAG, "Executing action: " + action);
final Activity activity = this.cordova.getActivity();
final Window window = activity.getWindow();
if ("_ready".equals(action)) {
boolean statusBarVisible = (window.getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) == 0;
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, statusBarVisible));
@@ -86,6 +88,17 @@ public class StatusBar extends CordovaPlugin {
this.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// SYSTEM_UI_FLAG_FULLSCREEN is available since JellyBean, but we
// use KitKat here to be aligned with "Fullscreen" preference
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
int uiOptions = window.getDecorView().getSystemUiVisibility();
uiOptions &= ~View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
uiOptions &= ~View.SYSTEM_UI_FLAG_FULLSCREEN;
window.getDecorView().setSystemUiVisibility(uiOptions);
return;
}
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
});
@@ -96,6 +109,17 @@ public class StatusBar extends CordovaPlugin {
this.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
// SYSTEM_UI_FLAG_FULLSCREEN is available since JellyBean, but we
// use KitKat here to be aligned with "Fullscreen" preference
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
int uiOptions = window.getDecorView().getSystemUiVisibility()
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_FULLSCREEN;
window.getDecorView().setSystemUiVisibility(uiOptions);
return;
}
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
});
-4
View File
@@ -32,11 +32,7 @@ module.exports = {
styleLightContent:notSupported,
styleBlackOpaque:notSupported,
overlaysWebView:notSupported,
overlaysWebView: notSupported,
styleDefault: notSupported,
styleLightContect: notSupported,
styleBlackTranslucent: notSupported,
styleBlackOpaque: notSupported,
backgroundColorByName: notSupported,
backgroundColorByHexString: notSupported,
hide: notSupported,
+10
View File
@@ -180,6 +180,16 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
- (void) initializeStatusBarBackgroundView
{
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
if ([[UIApplication sharedApplication]statusBarOrientation] == UIInterfaceOrientationPortraitUpsideDown &&
statusBarFrame.size.height + statusBarFrame.origin.y == [[UIScreen mainScreen] bounds].size.height) {
// When started in upside-down orientation on iOS 7, status bar will be bound to lower edge of the
// screen (statusBarFrame.origin.y will be somewhere around screen height). In this case we need to
// correct frame's coordinates
statusBarFrame.origin.y = 0;
}
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame orientation:self.viewController.interfaceOrientation];
_statusBarBackgroundView = [[UIView alloc] initWithFrame:statusBarFrame];
+1 -1
View File
@@ -22,7 +22,7 @@
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-statusbar-tests"
version="2.0.0">
version="2.1.0">
<name>Cordova StatusBar Plugin Tests</name>
<license>Apache 2.0</license>