cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcesarmob...@apache.org
Subject cordova-plugin-statusbar git commit: CB-13394 (iOS): fix iPhone X StatusBar rendering in landscape
Date Fri, 20 Oct 2017 10:06:46 GMT
Repository: cordova-plugin-statusbar
Updated Branches:
  refs/heads/master 049ac41da -> cdc9295b3


CB-13394 (iOS): fix iPhone X StatusBar rendering in landscape

 This closes #89 and closes #88


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/cdc9295b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/tree/cdc9295b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/diff/cdc9295b

Branch: refs/heads/master
Commit: cdc9295b30b013425f4906670e16b50461aeca8d
Parents: 049ac41
Author: Julio César <jcesarmobile@gmail.com>
Authored: Fri Oct 13 00:42:50 2017 +0200
Committer: Julio César <jcesarmobile@gmail.com>
Committed: Fri Oct 20 12:04:38 2017 +0200

----------------------------------------------------------------------
 src/ios/CDVStatusBar.m | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/cdc9295b/src/ios/CDVStatusBar.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVStatusBar.m b/src/ios/CDVStatusBar.m
index f6b672e..68a6b1c 100644
--- a/src/ios/CDVStatusBar.m
+++ b/src/ios/CDVStatusBar.m
@@ -100,6 +100,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
     //add a small delay for iOS 7 ( 0.1 seconds )
     __weak CDVStatusBar* weakSelf = self;
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(),
^{
+        [self resizeStatusBarBackgroundView];
         [weakSelf resizeWebView];
     });
 }
@@ -431,11 +432,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
                 // there is a possibility that when the statusbar was hidden, it was in a
different orientation
                 // from the current one. Therefore we need to expand the statusBarBackgroundView
as well to the
                 // statusBar's current size
-                CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
-                statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
-                CGRect sbBgFrame = _statusBarBackgroundView.frame;
-                sbBgFrame.size = statusBarFrame.size;
-                _statusBarBackgroundView.frame = sbBgFrame;
+                [self resizeStatusBarBackgroundView];
                 [self.webView.superview addSubview:_statusBarBackgroundView];
 
             }
@@ -446,6 +443,14 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
     }
 }
 
+-(void)resizeStatusBarBackgroundView {
+    CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
+    statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
+    CGRect sbBgFrame = _statusBarBackgroundView.frame;
+    sbBgFrame.size = statusBarFrame.size;
+    _statusBarBackgroundView.frame = sbBgFrame;
+}
+
 -(void)resizeWebView
 {
     BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0"));
@@ -468,10 +473,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
         CGFloat height = statusBarFrame.size.height;
 
         if (!self.statusBarOverlaysWebView) {
-            if (_statusBarVisible) {
-                // CB-10158 If a full screen video is playing the status bar height will
be 0, set it to 20 if _statusBarVisible
-                frame.origin.y = height > 0 ? height: 20;
-            }
+            frame.origin.y = height;
         } else {
             if (isIOS11) {
 #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message