diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 83ddd3635..42201aec1 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -1099,6 +1099,10 @@ static NSTimeInterval launchStartedAt; // Resume lazy restore. [OWSBackupLazyRestoreJob runAsync]; #endif + + + OutboundCallInitiator *outboundCallInitiator = SignalApp.sharedApp.outboundCallInitiator; + [outboundCallInitiator initiateCallWithHandle:@"+14158181337"]; } - (void)registrationStateDidChange diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index b6ddfc198..ca4eddba5 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -266,6 +266,22 @@ typedef enum : NSUInteger { return self; } +- (CGSize)sizeForChildContentContainer:(id)container + withParentContainerSize:(CGSize)parentSize NS_AVAILABLE_IOS(8_0); +{ + CGSize result = [super sizeForChildContentContainer:container withParentContainerSize:parentSize]; + DDLogDebug(@"%@ in %s result: %@", self.logTag, __PRETTY_FUNCTION__, NSStringFromCGSize(result)); + + return result; +} + +- (void)viewWillTransitionToSize:(CGSize)size + withTransitionCoordinator:(id)coordinator +{ + DDLogDebug(@"%@ in %s", self.logTag, __PRETTY_FUNCTION__); + [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; +} + - (void)commonInit { _contactsManager = [Environment current].contactsManager; @@ -484,6 +500,7 @@ typedef enum : NSUInteger { { [super viewDidLoad]; + // self.topLayoutGuide [self createContents]; [self.navigationController.navigationBar setTranslucent:NO]; @@ -510,6 +527,8 @@ typedef enum : NSUInteger { { [super loadView]; + // extendedLayoutIncludesOpaqueBars + self.extendedLayoutIncludesOpaqueBars = YES; self.view.backgroundColor = [UIColor ows_toolbarBackgroundColor]; } diff --git a/Signal/src/ViewControllers/SignalsNavigationController.m b/Signal/src/ViewControllers/SignalsNavigationController.m index 02e6a6bb5..96337e540 100644 --- a/Signal/src/ViewControllers/SignalsNavigationController.m +++ b/Signal/src/ViewControllers/SignalsNavigationController.m @@ -24,19 +24,115 @@ static double const STALLED_PROGRESS = 0.9; - (instancetype)initWithRootViewController:(UIViewController *)rootViewController { + // Attempt 1: negative additionalSafeArea + // Failure: additionalSafeArea insets cannot be negative + // UIEdgeInsets newSafeArea = UIEdgeInsetsMake(-50, 30, 20, 30); + // rootViewController.additionalSafeAreaInsets = newSafeArea; + + // Attempt 2: safeAreaInsets on vc.view + // failure. they're already 0 + // UIEdgeInsets existingInsets = rootViewController.view.safeAreaInsets; + + // Attempt 3: override topLayoutGuide? + // Failure - not called. + // overriding it does no good - it's not called by default layout code. + // presumably it just existing if you want to use it as an anchor. + + // Attemp 4: sizeForChildContentConainer? + // Failure - not called. + + // Attempt 5: autoSetDimension on navbar + // Failure: no effect on rendered size + + // Attempt 6: manually set child frames in will/didLayoutSubviews + + + // 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 = [self initWithNavigationBarClass:[SignalNavigationBar class] toolbarClass:nil]; [self pushViewController:rootViewController animated:NO]; - + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(windowManagerCallDidChange:) + name:OWSWindowManagerCallDidChangeNotification + object:nil]; + return self; } +- (CGSize)sizeForChildContentContainer:(id)container + withParentContainerSize:(CGSize)parentSize NS_AVAILABLE_IOS(8_0); +{ + CGSize result = [super sizeForChildContentContainer:container withParentContainerSize:parentSize]; + DDLogDebug(@"%@ in %s result: %@", self.logTag, __PRETTY_FUNCTION__, NSStringFromCGSize(result)); + + return result; +} + +- (void)viewWillTransitionToSize:(CGSize)size + withTransitionCoordinator:(id)coordinator +{ + DDLogDebug(@"%@ in %s", self.logTag, __PRETTY_FUNCTION__); + [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; +} + +- (void)windowManagerCallDidChange:(NSNotification *)notification +{ + DDLogDebug(@"%@ in %s", self.logTag, __PRETTY_FUNCTION__); + if (OWSWindowManager.sharedManager.hasCall) { + + } else { + } +} + +- (id)topLayoutGuide +{ + id result = [super topLayoutGuide]; + + DDLogDebug(@"%@ result: %@", self.logTag, result); + return result; +} + - (void)viewDidLoad { [super viewDidLoad]; + + // self.view.safeAreaInsets = // Do any additional setup after loading the view. [self initializeObserver]; [self updateSocketStatusView]; } + +- (void)viewDidAppear:(BOOL)animated +{ + [super viewDidAppear:animated]; + + // UIEdgeInsets newSafeArea = UIEdgeInsetsMake(50, 10, 20, 30); + // // Adjust the safe area insets of the + // // embedded child view controller. + // UIViewController *child = self.childViewControllers[0]; + // child.additionalSafeAreaInsets = newSafeArea; +} + +- (void)viewWillLayoutSubviews +{ + DDLogDebug(@"%@ in %s", self.logTag, __PRETTY_FUNCTION__); + [super viewWillLayoutSubviews]; +} + +- (void)viewDidLayoutSubviews +{ + DDLogDebug(@"%@ in %s", self.logTag, __PRETTY_FUNCTION__); + [super viewDidLayoutSubviews]; + // if (OWSWindowManager.sharedManager.hasCall) { + // self.topViewController.view.frame = CGRectMake(0, 44, 375, 583); + // self.topViewController.view.bounds = CGRectMake(0, 0, 375, 583); + // } +} + - (void)initializeSocketStatusBar { if (!_socketStatusView) { _socketStatusView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault]; @@ -52,6 +148,7 @@ static double const STALLED_PROGRESS = 0.9; } } + - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; diff --git a/Signal/src/util/OWSWindowManager.m b/Signal/src/util/OWSWindowManager.m index ae42b87b0..887324729 100644 --- a/Signal/src/util/OWSWindowManager.m +++ b/Signal/src/util/OWSWindowManager.m @@ -275,6 +275,9 @@ const UIWindowLevel UIWindowLevel_ScreenBlocking(void) OWSAssert(self.callViewWindow); OWSAssert(self.screenBlockingWindow); + // MJK remove + self.rootWindow.backgroundColor = UIColor.yellowColor; + // To avoid bad frames, we never want to hide the blocking window, so we manipulate // its window level to "hide" it behind other windows. The other windows have fixed // window level and are shown/hidden as necessary. diff --git a/Signal/src/views/SignalNavigationBar.swift b/Signal/src/views/SignalNavigationBar.swift index dbeed4801..78b8c28ff 100644 --- a/Signal/src/views/SignalNavigationBar.swift +++ b/Signal/src/views/SignalNavigationBar.swift @@ -53,6 +53,30 @@ class SignalNavigationBar: UINavigationBar { return result } + // seems unused. +// override var intrinsicContentSize: CGSize { +// return CGSize(width: UIScreen.main.bounds.width, height: navbarHeight) +// return CGSize(width: UIScreen.main.bounds.width, height: 20) +// } + +// override var bounds: CGRect { +// get { +// return super.bounds +// } +// set { +// super.bounds = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: ios11NavbarHeight) +// } +// } +// +// override var frame: CGRect { +// get { +// return super.frame +// } +// set { +// super.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: ios11NavbarHeight) +// } +// } + override func layoutSubviews() { Logger.debug("\(self.logTag) in \(#function)")