Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
573176e3a7 | ||
|
|
a464526477 | ||
|
|
97f87d36c1 | ||
|
|
e6e8c5be10 | ||
|
|
a4a1065c4f | ||
|
|
d853f828d6 | ||
|
|
3e9ce84a56 | ||
|
|
999ad4f6c2 |
@@ -20,6 +20,14 @@
|
||||
-->
|
||||
# Release Notes
|
||||
|
||||
### 2.1.1 (Feb 09, 2016)
|
||||
* [CB-10102](https://issues.apache.org/jira/browse/CB-10102) The removeObserver code was wrong and it might crash on plugin deallocation
|
||||
|
||||
### 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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cordova-plugin-statusbar",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.1",
|
||||
"description": "Cordova StatusBar Plugin",
|
||||
"cordova": {
|
||||
"id": "cordova-plugin-statusbar",
|
||||
|
||||
+2
-2
@@ -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.1">
|
||||
<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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
+11
-1
@@ -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];
|
||||
@@ -458,7 +468,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
|
||||
- (void) dealloc
|
||||
{
|
||||
[[UIApplication sharedApplication] removeObserver:self forKeyPath:@"statusBarHidden"];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self forKeyPath:UIApplicationDidChangeStatusBarFrameNotification];
|
||||
[[NSNotificationCenter defaultCenter]removeObserver:self name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -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.1">
|
||||
<name>Cordova StatusBar Plugin Tests</name>
|
||||
<license>Apache 2.0</license>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user