diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index ca4eddba5..89e9d8e81 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -528,7 +528,7 @@ typedef enum : NSUInteger { [super loadView]; // extendedLayoutIncludesOpaqueBars - self.extendedLayoutIncludesOpaqueBars = YES; + // self.extendedLayoutIncludesOpaqueBars = YES; self.view.backgroundColor = [UIColor ows_toolbarBackgroundColor]; } diff --git a/Signal/src/ViewControllers/SignalsNavigationController.m b/Signal/src/ViewControllers/SignalsNavigationController.m index 96337e540..dc263b4e2 100644 --- a/Signal/src/ViewControllers/SignalsNavigationController.m +++ b/Signal/src/ViewControllers/SignalsNavigationController.m @@ -49,9 +49,9 @@ static double const STALLED_PROGRESS = 0.9; // Attempt 7: Since we can't seem to *shrink* the navbar, maybe we can grow it. // make additionalSafeAreaInsets -// self.additionalSafeAreaInsets = UIEdgeInsetsMake(100, 0, 0, 0); - - + + [self updateAdditionalSafeAreaInsets]; + self = [self initWithNavigationBarClass:[SignalNavigationBar class] toolbarClass:nil]; [self pushViewController:rootViewController animated:NO]; @@ -82,9 +82,15 @@ static double const STALLED_PROGRESS = 0.9; - (void)windowManagerCallDidChange:(NSNotification *)notification { DDLogDebug(@"%@ in %s", self.logTag, __PRETTY_FUNCTION__); - if (OWSWindowManager.sharedManager.hasCall) { + [self updateAdditionalSafeAreaInsets]; +} +- (void)updateAdditionalSafeAreaInsets +{ + if (OWSWindowManager.sharedManager.hasCall) { + self.additionalSafeAreaInsets = UIEdgeInsetsMake(64, 0, 0, 0); } else { + self.additionalSafeAreaInsets = UIEdgeInsetsZero; } } diff --git a/Signal/src/util/OWSWindowManager.m b/Signal/src/util/OWSWindowManager.m index 887324729..7ca9ebe03 100644 --- a/Signal/src/util/OWSWindowManager.m +++ b/Signal/src/util/OWSWindowManager.m @@ -323,15 +323,15 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void) } CGRect defaultFrame = [UIScreen mainScreen].bounds; - if (isActiveCall) { - CGRect frameWithActiveCall = CGRectMake(0, - OWSWindowManagerCallScreenHeight(), - defaultFrame.size.width, - defaultFrame.size.height - OWSWindowManagerCallScreenHeight()); - self.rootWindow.frame = frameWithActiveCall; - } else { - self.rootWindow.frame = defaultFrame; - } + // if (isActiveCall) { + // CGRect frameWithActiveCall = CGRectMake(0, + // OWSWindowManagerCallScreenHeight(), + // defaultFrame.size.width, + // defaultFrame.size.height - OWSWindowManagerCallScreenHeight()); + // self.rootWindow.frame = frameWithActiveCall; + // } else { + self.rootWindow.frame = defaultFrame; + // } // By calling makeKeyAndVisible we ensure the rootViewController becomes firt responder. // In the normal case, that means the SignalViewController will call `becomeFirstResponder` diff --git a/Signal/src/views/SignalNavigationBar.swift b/Signal/src/views/SignalNavigationBar.swift index 78b8c28ff..017178c39 100644 --- a/Signal/src/views/SignalNavigationBar.swift +++ b/Signal/src/views/SignalNavigationBar.swift @@ -11,6 +11,7 @@ class SignalNavigationBar: UINavigationBar { // TODO - get a more precise value // TODO - test with other heights, e.g. w/ hotspot, w/ call in other app let navbarHeight: CGFloat = 44 + let callBannerHeight: CGFloat = 40 override init(frame: CGRect) { super.init(frame: frame) @@ -24,6 +25,11 @@ class SignalNavigationBar: UINavigationBar { } private func callDidChange() { +// if OWSWindowManager.shared().hasCall() { +// self.bounds.origin.y = -20 +// } else { +// self.bounds.origin.y = 0 +// } if #available(iOS 11, *) { self.layoutSubviews() } else { @@ -53,6 +59,23 @@ class SignalNavigationBar: UINavigationBar { return result } +// override var center: CGPoint { +// get { +// Logger.debug("\(self.logTag) in \(#function)") +// return super.center +// } +// set { +// Logger.debug("\(self.logTag) in \(#function)") +// if OWSWindowManager.shared().hasCall() { +// var translated = newValue +//// translated.y -= 20 +// super.center = translated +// } else { +// super.center = newValue +// } +// } +// } + // seems unused. // override var intrinsicContentSize: CGSize { // return CGSize(width: UIScreen.main.bounds.width, height: navbarHeight) @@ -87,7 +110,7 @@ class SignalNavigationBar: UINavigationBar { // let rect = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: self.navbarHeightWithoutStatusBar) // self.frame = CGRect(x: 0, y: 20, width: UI Screen.main.bounds.width, height: ios11NavbarHeight) - self.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: navbarHeight) + self.frame = CGRect(x: 0, y: callBannerHeight, width: UIScreen.main.bounds.width, height: navbarHeight) self.bounds = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: navbarHeight) super.layoutSubviews() @@ -95,9 +118,9 @@ class SignalNavigationBar: UINavigationBar { for subview in self.subviews { let stringFromClass = NSStringFromClass(subview.classForCoder) if stringFromClass.contains("BarBackground") { - subview.frame = self.bounds + subview.frame = self.bounds//.offsetBy(dx: 0, dy: 20) } else if stringFromClass.contains("BarContentView") { - subview.frame = self.bounds + subview.frame = self.bounds//.offsetBy(dx: 0, dy: 20) } } }