From 1d1ac928a858c899a2a3aa87c86fe4cd42b99bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20C=C3=A9sar?= Date: Thu, 1 Sep 2016 20:12:20 +0200 Subject: [PATCH] Removed duplicate code --- src/ios/CDVStatusBar.m | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/ios/CDVStatusBar.m b/src/ios/CDVStatusBar.m index 3f87a13..3e86de6 100644 --- a/src/ios/CDVStatusBar.m +++ b/src/ios/CDVStatusBar.m @@ -463,23 +463,20 @@ static const void *kStatusBarStyle = &kStatusBarStyle; } self.webView.frame = bounds; + CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; + statusBarFrame = [self invertFrameIfNeeded:statusBarFrame]; + CGRect frame = self.webView.frame; + if (!self.statusBarOverlaysWebView) { - CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; - statusBarFrame = [self invertFrameIfNeeded:statusBarFrame]; - CGRect frame = self.webView.frame; frame.origin.y = statusBarFrame.size.height; frame.size.height -= statusBarFrame.size.height; - self.webView.frame = frame; } else { // even if overlay is used, we want to handle in-call/recording/hotspot larger status bar - CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; - statusBarFrame = [self invertFrameIfNeeded:statusBarFrame]; - CGRect frame = self.webView.frame; CGFloat height = statusBarFrame.size.height; frame.origin.y = height >= 20 ? height - 20 : 0; frame.size.height -= frame.origin.y; - self.webView.frame = frame; } + self.webView.frame = frame; } else { CGRect bounds = [[UIScreen mainScreen] applicationFrame]; self.viewController.view.frame = bounds;