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-12196 (iOS) fix Status Bar Not Hiding
Date Wed, 28 Dec 2016 23:01:59 GMT
Repository: cordova-plugin-statusbar
Updated Branches:
  refs/heads/master a120ba1a1 -> fa57e92c5


CB-12196 (iOS) fix Status Bar Not Hiding

 This closes #74


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

Branch: refs/heads/master
Commit: fa57e92c5582d0edc7fc4b1f4be7f5e3380d93cf
Parents: a120ba1
Author: Julio César <jcesarmobile@gmail.com>
Authored: Tue Dec 27 20:32:54 2016 +0100
Committer: Julio César <jcesarmobile@gmail.com>
Committed: Thu Dec 29 00:01:19 2016 +0100

----------------------------------------------------------------------
 src/ios/CDVStatusBar.h |  1 +
 src/ios/CDVStatusBar.m | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/fa57e92c/src/ios/CDVStatusBar.h
----------------------------------------------------------------------
diff --git a/src/ios/CDVStatusBar.h b/src/ios/CDVStatusBar.h
index 84f37fa..0be08cc 100644
--- a/src/ios/CDVStatusBar.h
+++ b/src/ios/CDVStatusBar.h
@@ -30,6 +30,7 @@
 }
 
 @property (atomic, assign) BOOL statusBarOverlaysWebView;
+@property (atomic, assign) BOOL statusBarVisible;
 
 - (void) overlaysWebView:(CDVInvokedUrlCommand*)command;
 

http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/fa57e92c/src/ios/CDVStatusBar.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVStatusBar.m b/src/ios/CDVStatusBar.m
index ee1d6cb..58fbc29 100644
--- a/src/ios/CDVStatusBar.m
+++ b/src/ios/CDVStatusBar.m
@@ -146,6 +146,8 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
     [self.viewController.view sendSubviewToBack:fakeScrollView]; // Send it to the very back
of the view heirarchy
     fakeScrollView.contentSize = CGSizeMake(UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height
* 2.0f); // Make the scroll view longer than the screen itself
     fakeScrollView.contentOffset = CGPointMake(0.0f, UIScreen.mainScreen.bounds.size.height);
// Scroll down so a tap will take scroll view back to the top
+
+    _statusBarVisible = ![UIApplication sharedApplication].isStatusBarHidden;
 }
 
 - (void)onReset {
@@ -379,6 +381,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
 
 - (void) hide:(CDVInvokedUrlCommand*)command
 {
+    _statusBarVisible = NO;
     UIApplication* app = [UIApplication sharedApplication];
 
     if (!app.isStatusBarHidden)
@@ -411,6 +414,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
 
 - (void) show:(CDVInvokedUrlCommand*)command
 {
+    _statusBarVisible = YES;
     UIApplication* app = [UIApplication sharedApplication];
 
     if (app.isStatusBarHidden)
@@ -463,8 +467,10 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
         CGFloat height = statusBarFrame.size.height;
 
         if (!self.statusBarOverlaysWebView) {
-            // 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;
+            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;
+            }
         } else {
             // Even if overlay is used, we want to handle in-call/recording/hotspot larger
status bar
             frame.origin.y = height >= 20 ? height - 20 : 0;


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


Mime
View raw message