Compare commits

..
7 Commits
7 changed files with 48 additions and 13 deletions
-1
View File
@@ -17,7 +17,6 @@ Thanks!
### Checklist
- [ ] [ICLA](http://www.apache.org/licenses/icla.txt) has been signed and submitted to secretary@apache.org.
- [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
- [ ] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
- [ ] Added automated test coverage as appropriate for this change.
+21
View File
@@ -113,6 +113,11 @@ Properties
- StatusBar.isVisible
Events
------
- statusTap
Permissions
-----------
@@ -310,3 +315,19 @@ Supported Platforms
- Windows Phone 7
- Windows Phone 8
- Windows Phone 8.1
statusTap
=========
Listen for this event to know if the statusbar was tapped.
window.addEventListener('statusTap', function() {
// scroll-up with document.body.scrollTop = 0; or do whatever you want
});
Supported Platforms
-------------------
- iOS
+8
View File
@@ -20,6 +20,14 @@
-->
# Release Notes
### 2.2.1 (Dec 07, 2016)
* [CB-10288](https://issues.apache.org/jira/browse/CB-10288) statusbar plugin interaction with iOS multitasking
* [CB-10158](https://issues.apache.org/jira/browse/CB-10158) (ios) fix StatusBar issue when recovering from fullscreen video
* [CB-10341](https://issues.apache.org/jira/browse/CB-10341) ios, document statusTap event
* [CB-11191](https://issues.apache.org/jira/browse/CB-11191) Statusbar plugin causing issues with webview size
* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
### 2.2.0 (Sep 08, 2016)
* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
* Handle extended status bar on **iOS**
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-statusbar",
"version": "2.2.0",
"version": "2.2.1",
"description": "Cordova StatusBar Plugin",
"cordova": {
"id": "cordova-plugin-statusbar",
+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"
version="2.2.0">
version="2.2.1">
<name>StatusBar</name>
<description>Cordova StatusBar Plugin</description>
<license>Apache 2.0</license>
+16 -9
View File
@@ -90,6 +90,11 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
}
}
-(void)cordovaViewWillAppear:(NSNotification*)notification
{
[self resizeWebView];
}
-(void)statusBarDidChangeFrame:(NSNotification*)notification
{
//add a small delay for iOS 7 ( 0.1 seconds )
@@ -112,6 +117,8 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarDidChangeFrame:) name: UIApplicationDidChangeStatusBarFrameNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cordovaViewWillAppear:) name: @"CDVViewWillAppearNotification" object:nil];
_statusBarOverlaysWebView = YES; // default
[self initializeStatusBarBackgroundView];
@@ -182,7 +189,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
if ([[UIApplication sharedApplication]statusBarOrientation] == UIInterfaceOrientationPortraitUpsideDown &&
statusBarFrame.size.height + statusBarFrame.origin.y == [[UIScreen mainScreen] bounds].size.height) {
statusBarFrame.size.height + statusBarFrame.origin.y == [self.viewController.view.window 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
@@ -200,8 +207,8 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
- (CGRect) invertFrameIfNeeded:(CGRect)rect {
// landscape is where (width > height). On iOS < 8, we need to invert since frames are
// always in Portrait context
if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]) && (rect.size.width < rect.size.height)) {
// always in Portrait context. Do not run this on ios 8 or above to avoid breaking ipad pro multitask layout
if (!IsAtLeastiOSVersion(@"8.0") && UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
CGFloat temp = rect.size.width;
rect.size.width = rect.size.height;
rect.size.height = temp;
@@ -440,7 +447,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0"));
if (isIOS7) {
CGRect bounds = [[UIScreen mainScreen] bounds];
CGRect bounds = [self.viewController.view.window bounds];
bounds = [self invertFrameIfNeeded:bounds];
if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) {
@@ -466,16 +473,16 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
CGRect frame = self.webView.frame;
CGFloat height = statusBarFrame.size.height;
if (!self.statusBarOverlaysWebView) {
frame.origin.y = statusBarFrame.size.height;
frame.size.height -= statusBarFrame.size.height;
// CB-10158 If a full screen video is playing the status bar height will be 0, set it to 20
frame.origin.y = height > 0 ? height: 20;
} else {
// even if overlay is used, we want to handle in-call/recording/hotspot larger status bar
CGFloat height = statusBarFrame.size.height;
// Even if overlay is used, we want to handle in-call/recording/hotspot larger status bar
frame.origin.y = height >= 20 ? height - 20 : 0;
frame.size.height -= frame.origin.y;
}
frame.size.height -= frame.origin.y;
self.webView.frame = frame;
} else {
CGRect bounds = [[UIScreen mainScreen] applicationFrame];
+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.2.0">
version="2.2.1">
<name>Cordova StatusBar Plugin Tests</name>
<license>Apache 2.0</license>