Repository: cordova-plugin-statusbar Updated Branches: refs/heads/master 1923d4e91 -> 7fa66c0b6
fix ios warnings fix ios 7 deprecate warnigns 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/145fad67 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/tree/145fad67 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/diff/145fad67 Branch: refs/heads/master Commit: 145fad6764196588360934d8c02263c46b3153b9 Parents: b0b61af Author: Julio César <jcesarmob...@gmail.com> Authored: Mon Sep 14 20:43:48 2015 +0200 Committer: Julio César <jcesarmob...@gmail.com> Committed: Mon Sep 14 20:43:48 2015 +0200 ---------------------------------------------------------------------- src/ios/CDVStatusBar.m | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/145fad67/src/ios/CDVStatusBar.m ---------------------------------------------------------------------- diff --git a/src/ios/CDVStatusBar.m b/src/ios/CDVStatusBar.m index 3fac9a0..009abdb 100644 --- a/src/ios/CDVStatusBar.m +++ b/src/ios/CDVStatusBar.m @@ -179,7 +179,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle; - (CGRect) invertFrameIfNeeded:(CGRect)rect orientation:(UIInterfaceOrientation)orientation { // landscape is where (width > height). On iOS < 8, we need to invert since frames are // always in Portrait context - if (UIDeviceOrientationIsLandscape(orientation) && (rect.size.width < rect.size.height) ) { + if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]) && (rect.size.width < rect.size.height) && (rect.size.width < rect.size.height) ) { CGFloat temp = rect.size.width; rect.size.width = rect.size.height; rect.size.height = temp; @@ -201,7 +201,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle; if (statusBarOverlaysWebView) { [_statusBarBackgroundView removeFromSuperview]; - if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation)) { + if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]) && (rect.size.width < rect.size.height)) { self.webView.frame = CGRectMake(0, 0, bounds.size.height, bounds.size.width); } else { self.webView.frame = bounds; @@ -291,12 +291,22 @@ static const void *kStatusBarStyle = &kStatusBarStyle; - (void) styleBlackTranslucent:(CDVInvokedUrlCommand*)command { - [self setStyleForStatusBar:UIStatusBarStyleBlackTranslucent]; + #if __IPHONE_OS_VERSION_MAX_ALLOWED < 70000 + # define TRANSLUCENT_STYLE UIStatusBarStyleBlackTranslucent + #else + # define TRANSLUCENT_STYLE UIStatusBarStyleLightContent + #endif + [self setStyleForStatusBar:TRANSLUCENT_STYLE]; } - (void) styleBlackOpaque:(CDVInvokedUrlCommand*)command { - [self setStyleForStatusBar:UIStatusBarStyleBlackOpaque]; + #if __IPHONE_OS_VERSION_MAX_ALLOWED < 70000 + # define OPAQUE_STYLE UIStatusBarStyleBlackOpaque + #else + # define OPAQUE_STYLE UIStatusBarStyleLightContent + #endif + [self setStyleForStatusBar:OPAQUE_STYLE]; } - (void) backgroundColorByName:(CDVInvokedUrlCommand*)command @@ -356,7 +366,6 @@ static const void *kStatusBarStyle = &kStatusBarStyle; if (!app.isStatusBarHidden) { - self.viewController.wantsFullScreenLayout = YES; CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; [self hideStatusBar]; @@ -400,7 +409,6 @@ static const void *kStatusBarStyle = &kStatusBarStyle; if (app.isStatusBarHidden) { BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0")); - self.viewController.wantsFullScreenLayout = isIOS7; [self showStatusBar]; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org