You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2016/12/08 00:57:31 UTC
[6/7] cordova-plugin-statusbar git commit: CB-10288 statusbar plugin
interaction with iOS multitasking
CB-10288 statusbar plugin interaction with iOS multitasking
This closes #62
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/commit/6bfc749f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/tree/6bfc749f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/diff/6bfc749f
Branch: refs/heads/2.2.x
Commit: 6bfc749f846e44d2784e93fa7629ec3049ab418d
Parents: b7dc5ef
Author: Jonathan Li <jo...@sap.com>
Authored: Sun Aug 28 16:01:54 2016 -0400
Committer: Julio C�sar <jc...@gmail.com>
Committed: Sun Nov 13 23:14:11 2016 +0100
----------------------------------------------------------------------
src/ios/CDVStatusBar.m | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/6bfc749f/src/ios/CDVStatusBar.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVStatusBar.m b/src/ios/CDVStatusBar.m
index f563e49..37c6dcd 100644
--- a/src/ios/CDVStatusBar.m
+++ b/src/ios/CDVStatusBar.m
@@ -189,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
@@ -207,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;
@@ -447,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])) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org