From 5d6a9889556a27eba66195e49019b92092a0e6c7 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 29 Jun 2018 15:28:13 -0600 Subject: [PATCH 01/13] WIP navbar --- .../HomeView/HomeViewController.m | 3 +- SignalMessaging/categories/UIColor+OWS.h | 7 ++++ SignalMessaging/categories/UIColor+OWS.m | 16 +++++++++ SignalMessaging/utils/UIUtil.m | 34 ++++++++++--------- 4 files changed, 43 insertions(+), 17 deletions(-) diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index ed6e1e75d..ac3585d95 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -412,7 +412,8 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations // UIBarButtonItem in order to ensure that these buttons are spaced tightly. // The contents of the navigation bar are cramped in this view. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; - UIImage *image = [UIImage imageNamed:@"button_settings_white"]; + UIImage *image = [[UIImage imageNamed:@"button_settings_white"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + button.tintColor = UIColor.ows_navbarForegroundColor; [button setImage:image forState:UIControlStateNormal]; UIEdgeInsets imageEdgeInsets = UIEdgeInsetsZero; // We normally would want to use left and right insets that ensure the button diff --git a/SignalMessaging/categories/UIColor+OWS.h b/SignalMessaging/categories/UIColor+OWS.h index f65f219f6..d7445efca 100644 --- a/SignalMessaging/categories/UIColor+OWS.h +++ b/SignalMessaging/categories/UIColor+OWS.h @@ -8,6 +8,13 @@ NS_ASSUME_NONNULL_BEGIN @interface UIColor (OWS) +#pragma mark - Global App Colors + +@property (class, readonly, nonatomic) UIColor *ows_navbarBackgroundColor; +@property (class, readonly, nonatomic) UIColor *ows_navbarForegroundColor; + +#pragma mark - + @property (class, readonly, nonatomic) UIColor *ows_systemPrimaryButtonColor; @property (class, readonly, nonatomic) UIColor *ows_signalBrandBlueColor; @property (class, readonly, nonatomic) UIColor *ows_materialBlueColor; diff --git a/SignalMessaging/categories/UIColor+OWS.m b/SignalMessaging/categories/UIColor+OWS.m index a456c680e..1fe9aa645 100644 --- a/SignalMessaging/categories/UIColor+OWS.m +++ b/SignalMessaging/categories/UIColor+OWS.m @@ -10,6 +10,22 @@ NS_ASSUME_NONNULL_BEGIN @implementation UIColor (OWS) +#pragma mark - Global App Colors + ++ (UIColor *)ows_navbarBackgroundColor +{ + return UIColor.ows_whiteColor; +} + ++ (UIColor *)ows_navbarForegroundColor +{ +// return UIColor.ows_blackColor; + + return UIColor.greenColor; +} + +#pragma mark - + + (UIColor *)ows_signalBrandBlueColor { return [UIColor colorWithRed:0.1135657504 green:0.4787300229 blue:0.89595204589999999 alpha:1.]; diff --git a/SignalMessaging/utils/UIUtil.m b/SignalMessaging/utils/UIUtil.m index 1642d75a3..514f2c226 100644 --- a/SignalMessaging/utils/UIUtil.m +++ b/SignalMessaging/utils/UIUtil.m @@ -1,8 +1,9 @@ // -// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // #import "UIUtil.h" +#import "UIColor+OWS.h" #import #define CONTACT_PICTURE_VIEW_BORDER_WIDTH 0.5f @@ -34,31 +35,32 @@ + (void)applyDefaultSystemAppearence { - [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleDefault]; - [[UINavigationBar appearance] setBarStyle:UIBarStyleDefault]; - [[UINavigationBar appearance] setTintColor:[UIColor blackColor]]; - [[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]]; - [[UINavigationBar appearance] setTitleTextAttributes:@{ - NSForegroundColorAttributeName : [UIColor blackColor], - }]; +// [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleDefault]; +// [[UINavigationBar appearance] setBarStyle:UIBarStyleDefault]; +// [[UINavigationBar appearance] setTintColor:[UIColor blackColor]]; +// [[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]]; +// [[UINavigationBar appearance] setTitleTextAttributes:@{ +// NSForegroundColorAttributeName : [UIColor blackColor], +// }]; } + (void)applySignalAppearence { - [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleLightContent]; - [[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]]; - [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; + // [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleLightContent]; + UINavigationBar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor; + // [[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]]; + UINavigationBar.appearance.tintColor = UIColor.ows_navbarForegroundColor; - [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTintColor:[UIColor ows_materialBlueColor]]; +// [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTintColor:[UIColor ows_materialBlueColor]]; [[UISwitch appearance] setOnTintColor:[UIColor ows_materialBlueColor]]; [[UIToolbar appearance] setTintColor:[UIColor ows_materialBlueColor]]; - [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]]; +// [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]]; // If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored. - [[UINavigationBar appearance] setTitleTextAttributes:@{ - NSForegroundColorAttributeName : [UIColor whiteColor], - }]; + UINavigationBar.appearance.titleTextAttributes = @{ + NSForegroundColorAttributeName : UIColor.ows_navbarForegroundColor + }; } @end From 001aad00187ff2eb5306ec20628ee83b114004af Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 29 Jun 2018 16:13:51 -0600 Subject: [PATCH 02/13] dark status bar --- Signal/Signal-Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index 623b378a5..78ed4ca69 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -121,7 +121,7 @@ armv7 UIStatusBarStyle - UIStatusBarStyleLightContent + UIStatusBarStyleDefault UISupportedInterfaceOrientations UIInterfaceOrientationPortrait From f8abe32ae95d23b4a85e7a37df04cdd44e6d1b79 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 29 Jun 2018 16:16:09 -0600 Subject: [PATCH 03/13] more styling to new nav colors --- .../ConversationView/ConversationHeaderView.swift | 4 ++-- .../ConversationView/ConversationViewController.m | 9 +++++---- .../ViewControllers/MediaGalleryViewController.swift | 3 --- .../src/ViewControllers/MediaPageViewController.swift | 5 ++--- SignalMessaging/Views/OWSNavigationBar.swift | 3 ++- .../attachments/AttachmentApprovalViewController.swift | 1 - SignalMessaging/categories/UIViewController+OWS.m | 6 ++++-- SignalMessaging/utils/UIUtil.m | 10 +++++++--- SignalShareExtension/Info.plist | 2 +- 9 files changed, 23 insertions(+), 20 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationHeaderView.swift b/Signal/src/ViewControllers/ConversationView/ConversationHeaderView.swift index 202737872..85e25980b 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationHeaderView.swift +++ b/Signal/src/ViewControllers/ConversationView/ConversationHeaderView.swift @@ -64,13 +64,13 @@ public class ConversationHeaderView: UIStackView { avatarView.layer.borderWidth = 0 titleLabel = UILabel() - titleLabel.textColor = .white + titleLabel.textColor = .ows_navbarForeground titleLabel.lineBreakMode = .byTruncatingTail titleLabel.font = titlePrimaryFont titleLabel.setContentHuggingHigh() subtitleLabel = UILabel() - subtitleLabel.textColor = .white + subtitleLabel.textColor = .ows_navbarForeground subtitleLabel.lineBreakMode = .byTruncatingTail subtitleLabel.font = subtitleFont subtitleLabel.setContentHuggingHigh() diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index d534e8c07..bae004cfa 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -1379,6 +1379,7 @@ typedef enum : NSUInteger { { NSMutableAttributedString *subtitleText = [NSMutableAttributedString new]; + UIColor *subtitleColor = [UIColor.ows_navbarForegroundColor colorWithAlphaComponent:(CGFloat)0.9]; if (self.thread.isMuted) { // Show a "mute" icon before the navigation bar subtitle if this thread is muted. [subtitleText @@ -1386,7 +1387,7 @@ typedef enum : NSUInteger { initWithString:@"\ue067 " attributes:@{ NSFontAttributeName : [UIFont ows_elegantIconsFont:7.f], - NSForegroundColorAttributeName : [UIColor colorWithWhite:0.9f alpha:1.f], + NSForegroundColorAttributeName : subtitleColor }]]; } @@ -1405,7 +1406,7 @@ typedef enum : NSUInteger { initWithString:@"\uf00c " attributes:@{ NSFontAttributeName : [UIFont ows_fontAwesomeFont:10.f], - NSForegroundColorAttributeName : [UIColor colorWithWhite:0.9f alpha:1.f], + NSForegroundColorAttributeName : subtitleColor, }]]; } @@ -1415,7 +1416,7 @@ typedef enum : NSUInteger { initWithString:NSLocalizedString(@"GROUP_YOU_LEFT", @"") attributes:@{ NSFontAttributeName : self.headerView.subtitleFont, - NSForegroundColorAttributeName : [UIColor colorWithWhite:0.9f alpha:1.f], + NSForegroundColorAttributeName : subtitleColor, }]]; } else { [subtitleText appendAttributedString: @@ -1425,7 +1426,7 @@ typedef enum : NSUInteger { @"title can be tapped to access settings for this conversation.") attributes:@{ NSFontAttributeName : self.headerView.subtitleFont, - NSForegroundColorAttributeName : [UIColor colorWithWhite:0.9f alpha:1.f], + NSForegroundColorAttributeName : subtitleColor, }]]; } diff --git a/Signal/src/ViewControllers/MediaGalleryViewController.swift b/Signal/src/ViewControllers/MediaGalleryViewController.swift index d450bfb35..fd5255920 100644 --- a/Signal/src/ViewControllers/MediaGalleryViewController.swift +++ b/Signal/src/ViewControllers/MediaGalleryViewController.swift @@ -248,9 +248,6 @@ class MediaGalleryViewController: OWSNavigationController, MediaGalleryDataSourc // animate in our view, over the existing context, similar to a cross disolve, but allowing us to have // more fine grained control self.modalPresentationStyle = .custom - self.navigationBar.barTintColor = UIColor.ows_materialBlue - self.navigationBar.isTranslucent = false - self.navigationBar.isOpaque = true // The presentationView is only used during present/dismiss animations. // It's a static image of the media content. diff --git a/Signal/src/ViewControllers/MediaPageViewController.swift b/Signal/src/ViewControllers/MediaPageViewController.swift index d6b842607..43c6021dd 100644 --- a/Signal/src/ViewControllers/MediaPageViewController.swift +++ b/Signal/src/ViewControllers/MediaPageViewController.swift @@ -174,7 +174,6 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou let footerBar = UIToolbar() self.footerBar = footerBar - footerBar.barTintColor = UIColor.ows_signalBrandBlue self.videoPlayBarButton = UIBarButtonItem(barButtonSystemItem: .play, target: self, action: #selector(didPressPlayBarButton)) self.videoPauseBarButton = UIBarButtonItem(barButtonSystemItem: .pause, target: self, action: #selector(didPressPauseBarButton)) @@ -588,7 +587,7 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou lazy private var headerNameLabel: UILabel = { let label = UILabel() - label.textColor = .white + label.textColor = .ows_navbarForeground label.font = UIFont.ows_regularFont(withSize: 17) label.textAlignment = .center label.adjustsFontSizeToFitWidth = true @@ -599,7 +598,7 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou lazy private var headerDateLabel: UILabel = { let label = UILabel() - label.textColor = .white + label.textColor = .ows_navbarForeground label.font = UIFont.ows_regularFont(withSize: 12) label.textAlignment = .center label.adjustsFontSizeToFitWidth = true diff --git a/SignalMessaging/Views/OWSNavigationBar.swift b/SignalMessaging/Views/OWSNavigationBar.swift index 0acd85bf3..4c2837680 100644 --- a/SignalMessaging/Views/OWSNavigationBar.swift +++ b/SignalMessaging/Views/OWSNavigationBar.swift @@ -41,7 +41,8 @@ public class OWSNavigationBar: UINavigationBar { override init(frame: CGRect) { super.init(frame: frame) - self.isTranslucent = false + self.isOpaque = false + self.isTranslucent = true NotificationCenter.default.addObserver(self, selector: #selector(callDidChange), name: .OWSWindowManagerCallDidChange, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(didChangeStatusBarFrame), name: .UIApplicationDidChangeStatusBarFrame, object: nil) diff --git a/SignalMessaging/attachments/AttachmentApprovalViewController.swift b/SignalMessaging/attachments/AttachmentApprovalViewController.swift index cbe181b98..f9b87c7ed 100644 --- a/SignalMessaging/attachments/AttachmentApprovalViewController.swift +++ b/SignalMessaging/attachments/AttachmentApprovalViewController.swift @@ -70,7 +70,6 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool // Make navigationBar clear navController.navigationBar.backgroundColor = .clear navController.navigationBar.setBackgroundImage(UIImage(), for: .default) - navController.navigationBar.isTranslucent = true navController.navigationBar.shadowImage = UIImage() navController.navigationBar.clipsToBounds = true diff --git a/SignalMessaging/categories/UIViewController+OWS.m b/SignalMessaging/categories/UIViewController+OWS.m index 8d24f7505..8186b9025 100644 --- a/SignalMessaging/categories/UIViewController+OWS.m +++ b/SignalMessaging/categories/UIViewController+OWS.m @@ -2,8 +2,9 @@ // Copyright (c) 2018 Open Whisper Systems. All rights reserved. // -#import "UIView+OWS.h" #import "UIViewController+OWS.h" +#import "UIColor+OWS.h" +#import "UIView+OWS.h" NS_ASSUME_NONNULL_BEGIN @@ -71,9 +72,10 @@ NS_ASSUME_NONNULL_BEGIN // in a UIBarButtonItem. [backButton addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside]; - UIImage *backImage = [UIImage imageNamed:(isRTL ? @"NavBarBackRTL" : @"NavBarBack")]; + UIImage *backImage = [[UIImage imageNamed:(isRTL ? @"NavBarBackRTL" : @"NavBarBack")] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; OWSAssert(backImage); [backButton setImage:backImage forState:UIControlStateNormal]; + backButton.tintColor = UIColor.ows_navbarForegroundColor; backButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; diff --git a/SignalMessaging/utils/UIUtil.m b/SignalMessaging/utils/UIUtil.m index 514f2c226..0dbd93abb 100644 --- a/SignalMessaging/utils/UIUtil.m +++ b/SignalMessaging/utils/UIUtil.m @@ -50,13 +50,17 @@ UINavigationBar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor; // [[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]]; UINavigationBar.appearance.tintColor = UIColor.ows_navbarForegroundColor; + UIToolbar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor; + UIToolbar.appearance.tintColor = UIColor.ows_navbarForegroundColor; -// [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTintColor:[UIColor ows_materialBlueColor]]; + UIBarButtonItem.appearance.tintColor = UIColor.ows_navbarForegroundColor; + + // [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTintColor:[UIColor + // ows_materialBlueColor]]; [[UISwitch appearance] setOnTintColor:[UIColor ows_materialBlueColor]]; [[UIToolbar appearance] setTintColor:[UIColor ows_materialBlueColor]]; -// [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]]; - + // If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored. UINavigationBar.appearance.titleTextAttributes = @{ NSForegroundColorAttributeName : UIColor.ows_navbarForegroundColor diff --git a/SignalShareExtension/Info.plist b/SignalShareExtension/Info.plist index 2df5fa92c..142034873 100644 --- a/SignalShareExtension/Info.plist +++ b/SignalShareExtension/Info.plist @@ -81,7 +81,7 @@ fontawesome-webfont.ttf UIStatusBarStyle - UIStatusBarStyleLightContent + UIStatusBarStyleDefault UISupportedInterfaceOrientations UIInterfaceOrientationPortrait From d5fa7f9b2556d028beb13d2100cb045ba0b92018 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 29 Jun 2018 16:27:09 -0600 Subject: [PATCH 04/13] conversation view scrolls behind bars --- .../ConversationView/ConversationViewController.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index bae004cfa..aef912cc5 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -559,15 +559,13 @@ typedef enum : NSUInteger { self.collectionView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive; self.collectionView.backgroundColor = [UIColor whiteColor]; [self.view addSubview:self.collectionView]; - [self.collectionView autoPinWidthToSuperview]; - [self.collectionView autoPinToTopLayoutGuideOfViewController:self withInset:0]; + [self.collectionView autoPinEdgesToSuperviewEdges]; [self.collectionView applyScrollViewInsetsFix]; _inputToolbar = [[ConversationInputToolbar alloc] initWithConversationStyle:self.conversationStyle]; self.inputToolbar.inputToolbarDelegate = self; self.inputToolbar.inputTextViewDelegate = self; - [self.collectionView autoPinToBottomLayoutGuideOfViewController:self withInset:0]; self.loadMoreHeader = [UILabel new]; self.loadMoreHeader.text = NSLocalizedString(@"CONVERSATION_VIEW_LOADING_MORE_MESSAGES", From 104e63ded97e7b1c52033ae3ca433c564b9d53bb Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 29 Jun 2018 16:17:49 -0600 Subject: [PATCH 05/13] remove appearance juggling --- Signal/src/AppDelegate.m | 2 +- ...ShareToExistingContactViewController.swift | 21 ---------------- Signal/src/ViewControllers/AvatarViewHelper.m | 15 ++++-------- .../ContactShareViewHelper.swift | 13 ---------- .../ContactViewController.swift | 7 ------ .../ConversationViewController.m | 23 ++---------------- Signal/src/ViewControllers/InviteFlow.swift | 10 -------- .../MediaDetailViewController.m | 5 ---- .../NewContactThreadViewController.m | 6 ++--- .../Registration/RegistrationViewController.m | 2 +- .../FingerprintViewController.m | 8 ------- .../FingerprintViewScanController.m | 12 ---------- .../OWSAddToContactViewController.m | 3 --- .../OWSConversationSettingsViewController.m | 3 --- .../ShowGroupMembersViewController.m | 8 ------- Signal/src/util/MainAppContext.m | 5 ---- SignalMessaging/Views/ContactsViewHelper.h | 4 ---- SignalMessaging/Views/ContactsViewHelper.m | 10 -------- .../attachments/AttachmentSharing.m | 10 +------- .../contacts/SelectRecipientViewController.m | 2 +- SignalMessaging/utils/UIUtil.h | 4 +--- SignalMessaging/utils/UIUtil.m | 24 +------------------ .../utils/ShareAppExtensionContext.m | 5 ---- 23 files changed, 15 insertions(+), 187 deletions(-) diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index be9a3d338..df741815d 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -171,7 +171,7 @@ static NSTimeInterval launchStartedAt; [self versionMigrationsDidComplete]; }]; - [UIUtil applySignalAppearence]; + [UIUtil setupSignalAppearence]; if (CurrentAppContext().isRunningTests) { return YES; diff --git a/Signal/src/ViewControllers/AddContactShareToExistingContactViewController.swift b/Signal/src/ViewControllers/AddContactShareToExistingContactViewController.swift index c272d9f0e..8a2d5745a 100644 --- a/Signal/src/ViewControllers/AddContactShareToExistingContactViewController.swift +++ b/Signal/src/ViewControllers/AddContactShareToExistingContactViewController.swift @@ -87,17 +87,6 @@ class AddContactShareToExistingContactViewController: ContactsPicker, ContactsPi contactViewController.delegate = self let modal = OWSNavigationController(rootViewController: contactViewController) - - // HACK otherwise CNContactViewController Navbar is shows window background color. - // RADAR rdar://28433898 http://www.openradar.me/28433898 - // CNContactViewController incompatible with opaque navigation bar - modal.navigationBar.isTranslucent = true - if #available(iOS 10, *) { - // Contact navbar is blue in iOS9, so our white text works, - // but gray on iOS10+, in which case we want the system default black text. - UIUtil.applyDefaultSystemAppearence() - } - self.present(modal, animated: true) } @@ -146,16 +135,6 @@ class AddContactShareToExistingContactViewController: ContactsPicker, ContactsPi return } - // HACK otherwise CNContactViewController Navbar is shows window background color. - // RADAR rdar://28433898 http://www.openradar.me/28433898 - // CNContactViewController incompatible with opaque navigation bar - navigationController.navigationBar.isTranslucent = false - if #available(iOS 10, *) { - // Contact navbar is blue in iOS9, so our white text works, - // but gray on iOS10+, in which case we want the system default black text. - UIUtil.applySignalAppearence() - } - let previousViewControllerIndex = navigationController.viewControllers.index(before: myIndex) let previousViewController = navigationController.viewControllers[previousViewControllerIndex] diff --git a/Signal/src/ViewControllers/AvatarViewHelper.m b/Signal/src/ViewControllers/AvatarViewHelper.m index f58f34b30..7fa225122 100644 --- a/Signal/src/ViewControllers/AvatarViewHelper.m +++ b/Signal/src/ViewControllers/AvatarViewHelper.m @@ -81,9 +81,7 @@ NS_ASSUME_NONNULL_BEGIN picker.sourceType = UIImagePickerControllerSourceTypeCamera; picker.mediaTypes = @[ (__bridge NSString *)kUTTypeImage ]; - [self.delegate.fromViewController presentViewController:picker - animated:YES - completion:[UIUtil modalCompletionBlock]]; + [self.delegate.fromViewController presentViewController:picker animated:YES completion:nil]; }]; } @@ -103,9 +101,7 @@ NS_ASSUME_NONNULL_BEGIN picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; picker.mediaTypes = @[ (__bridge NSString *)kUTTypeImage ]; - [self.delegate.fromViewController presentViewController:picker - animated:YES - completion:[UIUtil modalCompletionBlock]]; + [self.delegate.fromViewController presentViewController:picker animated:YES completion:nil]; }]; } @@ -144,10 +140,9 @@ NS_ASSUME_NONNULL_BEGIN [self.delegate avatarDidChange:dstImage]; }); }]; - [self.delegate.fromViewController - presentViewController:vc - animated:YES - completion:[UIUtil modalCompletionBlock]]; + [self.delegate.fromViewController presentViewController:vc + animated:YES + completion:nil]; } }]; } diff --git a/Signal/src/ViewControllers/ContactShareViewHelper.swift b/Signal/src/ViewControllers/ContactShareViewHelper.swift index a83511380..849a096d5 100644 --- a/Signal/src/ViewControllers/ContactShareViewHelper.swift +++ b/Signal/src/ViewControllers/ContactShareViewHelper.swift @@ -167,16 +167,6 @@ public class ContactShareViewHelper: NSObject, CNContactViewControllerDelegate { action: #selector(didFinishEditingContact)) let modal = OWSNavigationController(rootViewController: contactViewController) - // HACK otherwise CNContactViewController Navbar is shows window background color. - // RADAR rdar://28433898 http://www.openradar.me/28433898 - // CNContactViewController incompatible with opaque navigation bar - modal.navigationBar.isTranslucent = true - if #available(iOS 10, *) { - // Contact navbar is blue in iOS9, so our white text works, - // but gray on iOS10+, in which case we want the system default black text. - UIUtil.applyDefaultSystemAppearence() - } - fromViewController.present(modal, animated: true) } @@ -197,7 +187,6 @@ public class ContactShareViewHelper: NSObject, CNContactViewControllerDelegate { } let viewController = AddContactShareToExistingContactViewController(contactShare: contactShare) - UIUtil.applySignalAppearence() navigationController.pushViewController(viewController, animated: true) } @@ -211,7 +200,6 @@ public class ContactShareViewHelper: NSObject, CNContactViewControllerDelegate { return } - UIUtil.applySignalAppearence() delegate.didCreateOrEditContact() } @@ -223,7 +211,6 @@ public class ContactShareViewHelper: NSObject, CNContactViewControllerDelegate { return } - UIUtil.applySignalAppearence() delegate.didCreateOrEditContact() } } diff --git a/Signal/src/ViewControllers/ContactViewController.swift b/Signal/src/ViewControllers/ContactViewController.swift index 174d33ec4..945a9628b 100644 --- a/Signal/src/ViewControllers/ContactViewController.swift +++ b/Signal/src/ViewControllers/ContactViewController.swift @@ -78,12 +78,6 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - // Use "dark" style status bar in this view, - // But we don't apply the entire default system UI (UIUtil.applyDefaultSystemAppearence) because - // doing so while pushing onto an existing nav controller who's navbars are hidden corrupts the - // title label/navbar items elsewhere in the stack. - CurrentAppContext().setStatusBarStyle(.default) - guard let navigationController = self.navigationController else { owsFail("\(logTag) in \(#function) navigationController was unexpectedly nil") return @@ -677,7 +671,6 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate { Logger.info("\(logTag) \(#function)") updateContent() - UIUtil.applySignalAppearence() self.dismiss(animated: true) } } diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index aef912cc5..838665036 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -676,9 +676,6 @@ typedef enum : NSUInteger { [super viewWillAppear:animated]; - // In case we're dismissing a CNContactViewController, or DocumentPicker which requires default system appearance - [UIUtil applySignalAppearence]; - // We need to recheck on every appearance, since the user may have left the group in the settings VC, // or on another device. [self hideInputIfNeeded]; @@ -2781,10 +2778,6 @@ typedef enum : NSUInteger { didPickDocumentPicker:(UIDocumentPickerViewController *)documentPicker { documentPicker.delegate = self; - if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(11, 0)) { - // post iOS11, document picker has no blue header. - [UIUtil applyDefaultSystemAppearence]; - } [self dismissKeyBoard]; [self presentViewController:documentPicker animated:YES completion:nil]; @@ -2796,16 +2789,6 @@ typedef enum : NSUInteger { { DDLogDebug(@"%@ Picked document at url: %@", self.logTag, url); - if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(11, 0)) { - // post iOS11, document picker has no blue header. - [UIUtil applySignalAppearence]; - } - - if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(11, 0)) { - // post iOS11, document picker has no blue header. - [UIUtil applySignalAppearence]; - } - NSString *type; NSError *typeError; [url getResourceValue:&type forKey:NSURLTypeIdentifierKey error:&typeError]; @@ -2896,7 +2879,7 @@ typedef enum : NSUInteger { picker.delegate = self; [self dismissKeyBoard]; - [self presentViewController:picker animated:YES completion:[UIUtil modalCompletionBlock]]; + [self presentViewController:picker animated:YES completion:nil]; }]; } @@ -2932,7 +2915,7 @@ typedef enum : NSUInteger { picker.mediaTypes = @[ (__bridge NSString *)kUTTypeImage, (__bridge NSString *)kUTTypeMovie ]; [self dismissKeyBoard]; - [self presentViewController:picker animated:YES completion:[UIUtil modalCompletionBlock]]; + [self presentViewController:picker animated:YES completion:nil]; }]; } @@ -2942,7 +2925,6 @@ typedef enum : NSUInteger { - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { - [UIUtil modalCompletionBlock](); [self dismissViewControllerAnimated:YES completion:nil]; } @@ -2959,7 +2941,6 @@ typedef enum : NSUInteger { - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { - [UIUtil modalCompletionBlock](); [self resetFrame]; NSURL *referenceURL = [info valueForKey:UIImagePickerControllerReferenceURL]; diff --git a/Signal/src/ViewControllers/InviteFlow.swift b/Signal/src/ViewControllers/InviteFlow.swift index dff342637..c4fbb5dcd 100644 --- a/Signal/src/ViewControllers/InviteFlow.swift +++ b/Signal/src/ViewControllers/InviteFlow.swift @@ -189,14 +189,6 @@ class InviteFlow: NSObject, MFMessageComposeViewControllerDelegate, MFMailCompos @objc public func sendSMSTo(phoneNumbers: [String]) { - if #available(iOS 10.0, *) { - // iOS10 message compose view doesn't respect some system appearence attributes. - // Specifically, the title is white, but the navbar is gray. - // So, we have to set system appearence before init'ing the message compose view controller in order - // to make its colors legible. - // Then we have to be sure to set it back in the ComposeViewControllerDelegate callback. - UIUtil.applyDefaultSystemAppearence() - } let messageComposeViewController = MFMessageComposeViewController() messageComposeViewController.messageComposeDelegate = self messageComposeViewController.recipients = phoneNumbers @@ -209,8 +201,6 @@ class InviteFlow: NSObject, MFMessageComposeViewControllerDelegate, MFMailCompos // MARK: MessageComposeViewControllerDelegate func messageComposeViewController(_ controller: MFMessageComposeViewController, didFinishWith result: MessageComposeResult) { - // Revert system styling applied to make messaging app legible on iOS10. - UIUtil.applySignalAppearence() self.presentingViewController.dismiss(animated: true) { switch result { case .failed: diff --git a/Signal/src/ViewControllers/MediaDetailViewController.m b/Signal/src/ViewControllers/MediaDetailViewController.m index a196643e3..9630f89ac 100644 --- a/Signal/src/ViewControllers/MediaDetailViewController.m +++ b/Signal/src/ViewControllers/MediaDetailViewController.m @@ -143,11 +143,6 @@ NS_ASSUME_NONNULL_BEGIN [super viewDidLoad]; [self createContents]; - - // Even though bars are opaque, we want content to be layed out behind them. - // The bars might obscure part of the content, but they can easily be hidden by tapping - // The alternative would be that content would shift when the navbars hide. - self.extendedLayoutIncludesOpaqueBars = YES; } - (void)viewWillAppear:(BOOL)animated diff --git a/Signal/src/ViewControllers/NewContactThreadViewController.m b/Signal/src/ViewControllers/NewContactThreadViewController.m index 53df870f0..855397520 100644 --- a/Signal/src/ViewControllers/NewContactThreadViewController.m +++ b/Signal/src/ViewControllers/NewContactThreadViewController.m @@ -745,12 +745,10 @@ NS_ASSUME_NONNULL_BEGIN if ([self presentedViewController]) { [self dismissViewControllerAnimated:YES completion:^{ - [self presentViewController:alertController - animated:YES - completion:[UIUtil modalCompletionBlock]]; + [self presentViewController:alertController animated:YES completion:nil]; }]; } else { - [self presentViewController:alertController animated:YES completion:[UIUtil modalCompletionBlock]]; + [self presentViewController:alertController animated:YES completion:nil]; } } diff --git a/Signal/src/ViewControllers/Registration/RegistrationViewController.m b/Signal/src/ViewControllers/Registration/RegistrationViewController.m index 682938575..9c990d626 100644 --- a/Signal/src/ViewControllers/Registration/RegistrationViewController.m +++ b/Signal/src/ViewControllers/Registration/RegistrationViewController.m @@ -485,7 +485,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi countryCodeController.countryCodeDelegate = self; OWSNavigationController *navigationController = [[OWSNavigationController alloc] initWithRootViewController:countryCodeController]; - [self presentViewController:navigationController animated:YES completion:[UIUtil modalCompletionBlock]]; + [self presentViewController:navigationController animated:YES completion:nil]; } - (void)backgroundTapped:(UIGestureRecognizer *)sender diff --git a/Signal/src/ViewControllers/ThreadSettings/FingerprintViewController.m b/Signal/src/ViewControllers/ThreadSettings/FingerprintViewController.m index d731f0f56..80cf20b1d 100644 --- a/Signal/src/ViewControllers/ThreadSettings/FingerprintViewController.m +++ b/Signal/src/ViewControllers/ThreadSettings/FingerprintViewController.m @@ -398,12 +398,6 @@ typedef void (^CustomLayoutBlock)(void); [self.view setNeedsLayout]; } -- (void)viewWillAppear:(BOOL)animated -{ - // In case we're returning from activity view that needed default system styles. - [UIUtil applySignalAppearence]; -} - #pragma mark - - (void)showSharingActivityWithCompletion:(nullable void (^)(void))completionHandler @@ -427,7 +421,6 @@ typedef void (^CustomLayoutBlock)(void); if (completionHandler) { completionHandler(); } - [UIUtil applySignalAppearence]; }; // This value was extracted by inspecting `activityType` in the activityController.completionHandler @@ -440,7 +433,6 @@ typedef void (^CustomLayoutBlock)(void); iCloudActivityType // This isn't being excluded. RADAR https://openradar.appspot.com/27493621 ]; - [UIUtil applyDefaultSystemAppearence]; [self presentViewController:activityController animated:YES completion:nil]; } diff --git a/Signal/src/ViewControllers/ThreadSettings/FingerprintViewScanController.m b/Signal/src/ViewControllers/ThreadSettings/FingerprintViewScanController.m index cce0be4f5..6775045ec 100644 --- a/Signal/src/ViewControllers/ThreadSettings/FingerprintViewScanController.m +++ b/Signal/src/ViewControllers/ThreadSettings/FingerprintViewScanController.m @@ -100,20 +100,8 @@ NS_ASSUME_NONNULL_BEGIN [cameraInstructionLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:instructionsVMargin]; } -- (void)viewWillAppear:(BOOL)animated -{ - // In case we're returning from activity view that needed default system styles. - [UIUtil applySignalAppearence]; -} - -- (void)viewWillDisappear:(BOOL)animated -{ - [super viewWillDisappear:YES]; -} - #pragma mark - Action - - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; diff --git a/Signal/src/ViewControllers/ThreadSettings/OWSAddToContactViewController.m b/Signal/src/ViewControllers/ThreadSettings/OWSAddToContactViewController.m index d60423603..7ac85c900 100644 --- a/Signal/src/ViewControllers/ThreadSettings/OWSAddToContactViewController.m +++ b/Signal/src/ViewControllers/ThreadSettings/OWSAddToContactViewController.m @@ -180,9 +180,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - - // In case we're dismissing a CNContactViewController which requires default system appearance - [UIUtil applySignalAppearence]; } #pragma mark - Actions diff --git a/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m b/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m index 016c4ce52..9c10fe940 100644 --- a/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m +++ b/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m @@ -852,9 +852,6 @@ NS_ASSUME_NONNULL_BEGIN { [super viewWillAppear:animated]; - // In case we're dismissing a CNContactViewController which requires default system appearance - [UIUtil applySignalAppearence]; - // HACK to unselect rows when swiping back // http://stackoverflow.com/questions/19379510/uitableviewcell-doesnt-get-deselected-when-swiping-back-quickly [self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:animated]; diff --git a/Signal/src/ViewControllers/ThreadSettings/ShowGroupMembersViewController.m b/Signal/src/ViewControllers/ThreadSettings/ShowGroupMembersViewController.m index 7a006f84a..2e890a740 100644 --- a/Signal/src/ViewControllers/ThreadSettings/ShowGroupMembersViewController.m +++ b/Signal/src/ViewControllers/ThreadSettings/ShowGroupMembersViewController.m @@ -105,14 +105,6 @@ NS_ASSUME_NONNULL_BEGIN [self updateTableContents]; } -- (void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; - - // In case we're dismissing a CNContactViewController which requires default system appearance - [UIUtil applySignalAppearence]; -} - #pragma mark - Table Contents - (void)updateTableContents diff --git a/Signal/src/util/MainAppContext.m b/Signal/src/util/MainAppContext.m index 7fed2dc6b..9eaa0f440 100644 --- a/Signal/src/util/MainAppContext.m +++ b/Signal/src/util/MainAppContext.m @@ -136,11 +136,6 @@ NS_ASSUME_NONNULL_BEGIN [[UIApplication sharedApplication] userInterfaceLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft; } -- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle -{ - [[UIApplication sharedApplication] setStatusBarStyle:statusBarStyle]; -} - - (void)setStatusBarHidden:(BOOL)isHidden animated:(BOOL)isAnimated { [[UIApplication sharedApplication] setStatusBarHidden:isHidden animated:isAnimated]; diff --git a/SignalMessaging/Views/ContactsViewHelper.h b/SignalMessaging/Views/ContactsViewHelper.h index e48b1675a..b367e6fa2 100644 --- a/SignalMessaging/Views/ContactsViewHelper.h +++ b/SignalMessaging/Views/ContactsViewHelper.h @@ -68,10 +68,6 @@ NS_ASSUME_NONNULL_BEGIN - (NSArray *)nonSignalContactsMatchingSearchString:(NSString *)searchText; -/** - * NOTE: This method calls `[UIUtil applyDefaultSystemAppearence]`. - * When using this method, you must call `[UIUtil applySignalAppearence]` once contact editing is finished; - */ - (void)presentContactViewControllerForRecipientId:(NSString *)recipientId fromViewController:(UIViewController *)fromViewController editImmediately:(BOOL)shouldEditImmediately; diff --git a/SignalMessaging/Views/ContactsViewHelper.m b/SignalMessaging/Views/ContactsViewHelper.m index b6872af6b..581c16a4a 100644 --- a/SignalMessaging/Views/ContactsViewHelper.m +++ b/SignalMessaging/Views/ContactsViewHelper.m @@ -394,16 +394,6 @@ NS_ASSUME_NONNULL_BEGIN OWSNavigationController *modal = [[OWSNavigationController alloc] initWithRootViewController:contactViewController]; - // HACK otherwise CNContactViewController Navbar is shows window background color. - // RADAR rdar://28433898 http://www.openradar.me/28433898 - // CNContactViewController incompatible with opaque navigation bar - modal.navigationBar.translucent = YES; - if (@available(iOS 10, *)) { - // Contact navbar is blue in iOS9, so our white tex works, - // but gray on iOS10+, in which case we want the system default black text. - [UIUtil applyDefaultSystemAppearence]; - } - // We want the presentation to imply a "replacement" in this case. if (shouldEditImmediately) { modal.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; diff --git a/SignalMessaging/attachments/AttachmentSharing.m b/SignalMessaging/attachments/AttachmentSharing.m index c648ccd18..eb8603c25 100644 --- a/SignalMessaging/attachments/AttachmentSharing.m +++ b/SignalMessaging/attachments/AttachmentSharing.m @@ -74,9 +74,6 @@ NS_ASSUME_NONNULL_BEGIN NSArray *__nullable returnedItems, NSError *__nullable activityError) { - DDLogDebug(@"%@ applying signal appearence", self.logTag); - [UIUtil applySignalAppearence]; - if (activityError) { DDLogInfo(@"%@ Failed to share with activityError: %@", self.logTag, activityError); } else if (completed) { @@ -93,12 +90,7 @@ NS_ASSUME_NONNULL_BEGIN fromViewController = fromViewController.presentedViewController; } OWSAssert(fromViewController); - [fromViewController presentViewController:activityViewController - animated:YES - completion:^{ - DDLogDebug(@"%@ applying default system appearence", self.logTag); - [UIUtil applyDefaultSystemAppearence]; - }]; + [fromViewController presentViewController:activityViewController animated:YES completion:nil]; }); } diff --git a/SignalMessaging/contacts/SelectRecipientViewController.m b/SignalMessaging/contacts/SelectRecipientViewController.m index 1251615df..9992043ad 100644 --- a/SignalMessaging/contacts/SelectRecipientViewController.m +++ b/SignalMessaging/contacts/SelectRecipientViewController.m @@ -270,7 +270,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien } else { OWSNavigationController *navigationController = [[OWSNavigationController alloc] initWithRootViewController:countryCodeController]; - [self presentViewController:navigationController animated:YES completion:[UIUtil modalCompletionBlock]]; + [self presentViewController:navigationController animated:YES completion:nil]; } } diff --git a/SignalMessaging/utils/UIUtil.h b/SignalMessaging/utils/UIUtil.h index cb8a9ef8f..5119c7eda 100644 --- a/SignalMessaging/utils/UIUtil.h +++ b/SignalMessaging/utils/UIUtil.h @@ -20,8 +20,6 @@ typedef void (^completionBlock)(void); + (void)applyRoundedBorderToImageView:(UIImageView *)imageView; + (void)removeRoundedBorderToImageView:(UIImageView *__strong *)imageView; -+ (completionBlock)modalCompletionBlock; -+ (void)applyDefaultSystemAppearence; -+ (void)applySignalAppearence; ++ (void)setupSignalAppearence; @end diff --git a/SignalMessaging/utils/UIUtil.m b/SignalMessaging/utils/UIUtil.m index 0dbd93abb..3d3f77881 100644 --- a/SignalMessaging/utils/UIUtil.m +++ b/SignalMessaging/utils/UIUtil.m @@ -24,31 +24,9 @@ [[*imageView layer] setCornerRadius:0]; } -+ (completionBlock)modalCompletionBlock ++ (void)setupSignalAppearence { - completionBlock block = ^void() { - [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleLightContent]; - }; - - return block; -} - -+ (void)applyDefaultSystemAppearence -{ -// [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleDefault]; -// [[UINavigationBar appearance] setBarStyle:UIBarStyleDefault]; -// [[UINavigationBar appearance] setTintColor:[UIColor blackColor]]; -// [[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]]; -// [[UINavigationBar appearance] setTitleTextAttributes:@{ -// NSForegroundColorAttributeName : [UIColor blackColor], -// }]; -} - -+ (void)applySignalAppearence -{ - // [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleLightContent]; UINavigationBar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor; - // [[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]]; UINavigationBar.appearance.tintColor = UIColor.ows_navbarForegroundColor; UIToolbar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor; UIToolbar.appearance.tintColor = UIColor.ows_navbarForegroundColor; diff --git a/SignalShareExtension/utils/ShareAppExtensionContext.m b/SignalShareExtension/utils/ShareAppExtensionContext.m index 35dec6ddc..835616ce7 100644 --- a/SignalShareExtension/utils/ShareAppExtensionContext.m +++ b/SignalShareExtension/utils/ShareAppExtensionContext.m @@ -130,11 +130,6 @@ NS_ASSUME_NONNULL_BEGIN == NSLocaleLanguageDirectionRightToLeft; } -- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle -{ - DDLogInfo(@"Ignoring request to set status bar style since we're in an app extension"); -} - - (void)setStatusBarHidden:(BOOL)isHidden animated:(BOOL)isAnimated { DDLogInfo(@"Ignoring request to show/hide status bar style since we're in an app extension"); From 767f06b09f7d1f105a949d6051732c98fdec5224 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 29 Jun 2018 16:48:43 -0600 Subject: [PATCH 06/13] fixup status bar --- Signal/Signal-Info.plist | 2 +- Signal/src/util/MainAppContext.m | 5 +++++ SignalMessaging/utils/UIUtil.m | 3 +++ SignalShareExtension/Info.plist | 2 +- SignalShareExtension/utils/ShareAppExtensionContext.m | 7 ++++++- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index 78ed4ca69..623b378a5 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -121,7 +121,7 @@ armv7 UIStatusBarStyle - UIStatusBarStyleDefault + UIStatusBarStyleLightContent UISupportedInterfaceOrientations UIInterfaceOrientationPortrait diff --git a/Signal/src/util/MainAppContext.m b/Signal/src/util/MainAppContext.m index 9eaa0f440..7fed2dc6b 100644 --- a/Signal/src/util/MainAppContext.m +++ b/Signal/src/util/MainAppContext.m @@ -136,6 +136,11 @@ NS_ASSUME_NONNULL_BEGIN [[UIApplication sharedApplication] userInterfaceLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft; } +- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle +{ + [[UIApplication sharedApplication] setStatusBarStyle:statusBarStyle]; +} + - (void)setStatusBarHidden:(BOOL)isHidden animated:(BOOL)isAnimated { [[UIApplication sharedApplication] setStatusBarHidden:isHidden animated:isAnimated]; diff --git a/SignalMessaging/utils/UIUtil.m b/SignalMessaging/utils/UIUtil.m index 3d3f77881..24bb1adcc 100644 --- a/SignalMessaging/utils/UIUtil.m +++ b/SignalMessaging/utils/UIUtil.m @@ -32,6 +32,9 @@ UIToolbar.appearance.tintColor = UIColor.ows_navbarForegroundColor; UIBarButtonItem.appearance.tintColor = UIColor.ows_navbarForegroundColor; + // Because our launch screen is blue, we specify the light content in our plist + // but once the app has loaded we want to switch to dark. + [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleDefault]; // [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTintColor:[UIColor // ows_materialBlueColor]]; diff --git a/SignalShareExtension/Info.plist b/SignalShareExtension/Info.plist index 142034873..2df5fa92c 100644 --- a/SignalShareExtension/Info.plist +++ b/SignalShareExtension/Info.plist @@ -81,7 +81,7 @@ fontawesome-webfont.ttf UIStatusBarStyle - UIStatusBarStyleDefault + UIStatusBarStyleLightContent UISupportedInterfaceOrientations UIInterfaceOrientationPortrait diff --git a/SignalShareExtension/utils/ShareAppExtensionContext.m b/SignalShareExtension/utils/ShareAppExtensionContext.m index 835616ce7..a35a2d8dd 100644 --- a/SignalShareExtension/utils/ShareAppExtensionContext.m +++ b/SignalShareExtension/utils/ShareAppExtensionContext.m @@ -130,9 +130,14 @@ NS_ASSUME_NONNULL_BEGIN == NSLocaleLanguageDirectionRightToLeft; } +- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle +{ + DDLogInfo(@"Ignoring request to set status bar style since we're in an app extension"); +} + - (void)setStatusBarHidden:(BOOL)isHidden animated:(BOOL)isAnimated { - DDLogInfo(@"Ignoring request to show/hide status bar style since we're in an app extension"); + DDLogInfo(@"Ignoring request to show/hide status bar since we're in an app extension"); } - (CGFloat)statusBarHeight From ee898829a19fdc5026d786b0bcb3b56950bf4e39 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 29 Jun 2018 16:49:24 -0600 Subject: [PATCH 07/13] fixup white nav --- .../ConversationView/ConversationViewController.m | 6 +++--- Signal/src/ViewControllers/HomeView/HomeViewController.m | 2 ++ SignalMessaging/ViewControllers/OWSTableViewController.m | 4 +--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 838665036..c464ee2f2 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -1320,11 +1320,11 @@ typedef enum : NSUInteger { if (OWSWindowManager.sharedManager.hasCall) { callButton.enabled = NO; callButton.userInteractionEnabled = NO; - callButton.tintColor = UIColor.lightGrayColor; + callButton.tintColor = [UIColor.ows_navbarForegroundColor colorWithAlphaComponent:0.7]; } else { callButton.enabled = YES; callButton.userInteractionEnabled = YES; - callButton.tintColor = UIColor.whiteColor; + callButton.tintColor = UIColor.ows_navbarForegroundColor; } UIEdgeInsets imageEdgeInsets = UIEdgeInsetsZero; @@ -1352,7 +1352,7 @@ typedef enum : NSUInteger { DisappearingTimerConfigurationView *timerView = [[DisappearingTimerConfigurationView alloc] initWithDurationSeconds:self.disappearingMessagesConfiguration.durationSeconds]; timerView.delegate = self; - timerView.tintColor = UIColor.whiteColor; + timerView.tintColor = UIColor.ows_navbarForegroundColor; // As of iOS11, we can size barButton item custom views with autoLayout. // Before that, though we can still use autoLayout *within* the customView, diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index ac3585d95..b25059a1f 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -275,6 +275,8 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations [self.view addSubview:self.tableView]; [self.tableView autoPinWidthToSuperview]; [self.tableView autoPinEdgeToSuperviewEdge:ALEdgeBottom]; + + // TODO - have content scroll behind navbar will require changing this. [self.tableView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:reminderStackView]; self.tableView.rowHeight = UITableViewAutomaticDimension; self.tableView.estimatedRowHeight = 60; diff --git a/SignalMessaging/ViewControllers/OWSTableViewController.m b/SignalMessaging/ViewControllers/OWSTableViewController.m index fe93caee5..624160eb9 100644 --- a/SignalMessaging/ViewControllers/OWSTableViewController.m +++ b/SignalMessaging/ViewControllers/OWSTableViewController.m @@ -457,9 +457,7 @@ NSString *const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier"; [self.tableView applyScrollViewInsetsFix]; [self.view addSubview:self.tableView]; - [self.tableView autoPinWidthToSuperview]; - [self.tableView autoPinToTopLayoutGuideOfViewController:self withInset:0]; - [self.tableView autoPinEdgeToSuperviewEdge:ALEdgeBottom]; + [self.tableView autoPinEdgesToSuperviewEdges]; [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kOWSTableCellIdentifier]; } From fd22c6cf2020e82e3ce6d056484dafd7afb7dd77 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 29 Jun 2018 16:49:35 -0600 Subject: [PATCH 08/13] fix warnings in conversation input toolbar --- .../ConversationView/ConversationInputToolbar.h | 2 ++ .../ConversationView/ConversationInputToolbar.m | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.h b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.h index f4bd94382..085e25d30 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.h +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.h @@ -35,6 +35,8 @@ NS_ASSUME_NONNULL_BEGIN @interface ConversationInputToolbar : UIView - (instancetype)initWithConversationStyle:(ConversationStyle *)conversationStyle NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE; +- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; @property (nonatomic, weak) id inputToolbarDelegate; diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m index bf322458d..dc4deddb4 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m @@ -70,8 +70,8 @@ static const CGFloat ConversationInputToolbarBorderViewHeight = 0.5; - (instancetype)initWithConversationStyle:(ConversationStyle *)conversationStyle { - self = [super init]; - + self = [super initWithFrame:CGRectZero]; + _conversationStyle = conversationStyle; if (self) { From 126d41e542860147788139d4749e26c593470cc7 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 29 Jun 2018 16:58:26 -0600 Subject: [PATCH 09/13] Fixup "scroll down" button so it doesn't fall behind toolbar --- .../ConversationView/ConversationViewController.m | 4 ++-- SignalMessaging/categories/UIColor+OWS.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index c464ee2f2..2b9ee898d 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -535,6 +535,7 @@ typedef enum : NSUInteger { { [super loadView]; + // make sure toolbar extends below iPhoneX home button. self.view.backgroundColor = [UIColor ows_toolbarBackgroundColor]; } @@ -2582,8 +2583,7 @@ typedef enum : NSUInteger { [self.scrollDownButton autoSetDimension:ALDimensionWidth toSize:ConversationScrollButton.buttonSize]; [self.scrollDownButton autoSetDimension:ALDimensionHeight toSize:ConversationScrollButton.buttonSize]; - self.scrollDownButtonButtomConstraint = - [self.scrollDownButton autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.collectionView]; + self.scrollDownButtonButtomConstraint = [self.scrollDownButton autoPinEdgeToSuperviewMargin:ALEdgeBottom]; [self.scrollDownButton autoPinEdgeToSuperviewEdge:ALEdgeTrailing]; #ifdef DEBUG diff --git a/SignalMessaging/categories/UIColor+OWS.m b/SignalMessaging/categories/UIColor+OWS.m index 1fe9aa645..f6e5dbf18 100644 --- a/SignalMessaging/categories/UIColor+OWS.m +++ b/SignalMessaging/categories/UIColor+OWS.m @@ -91,7 +91,7 @@ NS_ASSUME_NONNULL_BEGIN + (UIColor *)ows_toolbarBackgroundColor { - return [self colorWithWhite:245 / 255.f alpha:1.f]; + return self.ows_navbarBackgroundColor; } + (UIColor *)ows_lightBackgroundColor From 33ab3a663c7e4c4e87d4aad8396ebe891d25678c Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 29 Jun 2018 17:15:35 -0600 Subject: [PATCH 10/13] opaque conversation input toolbar --- .../ConversationView/ConversationInputToolbar.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m index dc4deddb4..42e6bb423 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m @@ -78,7 +78,6 @@ static const CGFloat ConversationInputToolbarBorderViewHeight = 0.5; [self createContents]; } - return self; } @@ -104,7 +103,18 @@ static const CGFloat ConversationInputToolbarBorderViewHeight = 0.5; { self.layoutMargins = UIEdgeInsetsZero; - self.backgroundColor = [UIColor ows_toolbarBackgroundColor]; + if (UIAccessibilityIsReduceTransparencyEnabled()) { + self.backgroundColor = [UIColor ows_toolbarBackgroundColor]; + } else { + // We can mute the blur by making our background color more opaque. + self.backgroundColor = [[UIColor ows_toolbarBackgroundColor] colorWithAlphaComponent:0.6]; + + UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight]; + UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; + [self addSubview:blurEffectView]; + [blurEffectView autoPinEdgesToSuperviewEdges]; + } + self.autoresizingMask = UIViewAutoresizingFlexibleHeight; UIView *borderView = [UIView new]; From 5719aba91a0aade98edd88781b52bdebe22883c4 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 29 Jun 2018 17:47:04 -0600 Subject: [PATCH 11/13] separate icon vs. title color for toolbars --- .../ConversationView/ConversationHeaderView.swift | 4 ++-- .../ConversationView/ConversationViewController.m | 8 ++++---- .../src/ViewControllers/HomeView/HomeViewController.m | 2 +- .../src/ViewControllers/MediaPageViewController.swift | 4 ++-- SignalMessaging/categories/UIColor+OWS.h | 3 ++- SignalMessaging/categories/UIColor+OWS.m | 11 +++++++---- SignalMessaging/categories/UIViewController+OWS.m | 2 +- SignalMessaging/utils/UIUtil.m | 10 ++++------ 8 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationHeaderView.swift b/Signal/src/ViewControllers/ConversationView/ConversationHeaderView.swift index 85e25980b..abc37ce7f 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationHeaderView.swift +++ b/Signal/src/ViewControllers/ConversationView/ConversationHeaderView.swift @@ -64,13 +64,13 @@ public class ConversationHeaderView: UIStackView { avatarView.layer.borderWidth = 0 titleLabel = UILabel() - titleLabel.textColor = .ows_navbarForeground + titleLabel.textColor = .ows_navbarTitle titleLabel.lineBreakMode = .byTruncatingTail titleLabel.font = titlePrimaryFont titleLabel.setContentHuggingHigh() subtitleLabel = UILabel() - subtitleLabel.textColor = .ows_navbarForeground + subtitleLabel.textColor = .ows_navbarTitle subtitleLabel.lineBreakMode = .byTruncatingTail subtitleLabel.font = subtitleFont subtitleLabel.setContentHuggingHigh() diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 2b9ee898d..0ba61c8ff 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -1321,11 +1321,11 @@ typedef enum : NSUInteger { if (OWSWindowManager.sharedManager.hasCall) { callButton.enabled = NO; callButton.userInteractionEnabled = NO; - callButton.tintColor = [UIColor.ows_navbarForegroundColor colorWithAlphaComponent:0.7]; + callButton.tintColor = [UIColor.ows_navbarIconColor colorWithAlphaComponent:0.7]; } else { callButton.enabled = YES; callButton.userInteractionEnabled = YES; - callButton.tintColor = UIColor.ows_navbarForegroundColor; + callButton.tintColor = UIColor.ows_navbarIconColor; } UIEdgeInsets imageEdgeInsets = UIEdgeInsetsZero; @@ -1353,7 +1353,7 @@ typedef enum : NSUInteger { DisappearingTimerConfigurationView *timerView = [[DisappearingTimerConfigurationView alloc] initWithDurationSeconds:self.disappearingMessagesConfiguration.durationSeconds]; timerView.delegate = self; - timerView.tintColor = UIColor.ows_navbarForegroundColor; + timerView.tintColor = UIColor.ows_navbarIconColor; // As of iOS11, we can size barButton item custom views with autoLayout. // Before that, though we can still use autoLayout *within* the customView, @@ -1375,7 +1375,7 @@ typedef enum : NSUInteger { { NSMutableAttributedString *subtitleText = [NSMutableAttributedString new]; - UIColor *subtitleColor = [UIColor.ows_navbarForegroundColor colorWithAlphaComponent:(CGFloat)0.9]; + UIColor *subtitleColor = [UIColor.ows_navbarTitleColor colorWithAlphaComponent:(CGFloat)0.9]; if (self.thread.isMuted) { // Show a "mute" icon before the navigation bar subtitle if this thread is muted. [subtitleText diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index b25059a1f..9b22b1a56 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -415,7 +415,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations // The contents of the navigation bar are cramped in this view. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; UIImage *image = [[UIImage imageNamed:@"button_settings_white"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - button.tintColor = UIColor.ows_navbarForegroundColor; + button.tintColor = UIColor.ows_navbarIconColor; [button setImage:image forState:UIControlStateNormal]; UIEdgeInsets imageEdgeInsets = UIEdgeInsetsZero; // We normally would want to use left and right insets that ensure the button diff --git a/Signal/src/ViewControllers/MediaPageViewController.swift b/Signal/src/ViewControllers/MediaPageViewController.swift index 43c6021dd..27b15d3fe 100644 --- a/Signal/src/ViewControllers/MediaPageViewController.swift +++ b/Signal/src/ViewControllers/MediaPageViewController.swift @@ -587,7 +587,7 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou lazy private var headerNameLabel: UILabel = { let label = UILabel() - label.textColor = .ows_navbarForeground + label.textColor = .ows_navbarTitle label.font = UIFont.ows_regularFont(withSize: 17) label.textAlignment = .center label.adjustsFontSizeToFitWidth = true @@ -598,7 +598,7 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou lazy private var headerDateLabel: UILabel = { let label = UILabel() - label.textColor = .ows_navbarForeground + label.textColor = .ows_navbarTitle label.font = UIFont.ows_regularFont(withSize: 12) label.textAlignment = .center label.adjustsFontSizeToFitWidth = true diff --git a/SignalMessaging/categories/UIColor+OWS.h b/SignalMessaging/categories/UIColor+OWS.h index d7445efca..56704f16c 100644 --- a/SignalMessaging/categories/UIColor+OWS.h +++ b/SignalMessaging/categories/UIColor+OWS.h @@ -11,7 +11,8 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Global App Colors @property (class, readonly, nonatomic) UIColor *ows_navbarBackgroundColor; -@property (class, readonly, nonatomic) UIColor *ows_navbarForegroundColor; +@property (class, readonly, nonatomic) UIColor *ows_navbarIconColor; +@property (class, readonly, nonatomic) UIColor *ows_navbarTitleColor; #pragma mark - diff --git a/SignalMessaging/categories/UIColor+OWS.m b/SignalMessaging/categories/UIColor+OWS.m index f6e5dbf18..d8447eb65 100644 --- a/SignalMessaging/categories/UIColor+OWS.m +++ b/SignalMessaging/categories/UIColor+OWS.m @@ -17,11 +17,14 @@ NS_ASSUME_NONNULL_BEGIN return UIColor.ows_whiteColor; } -+ (UIColor *)ows_navbarForegroundColor ++ (UIColor *)ows_navbarIconColor { -// return UIColor.ows_blackColor; - - return UIColor.greenColor; + return UIColor.ows_light60Color; +} + ++ (UIColor *)ows_navbarTitleColor +{ + return UIColor.ows_light90Color; } #pragma mark - diff --git a/SignalMessaging/categories/UIViewController+OWS.m b/SignalMessaging/categories/UIViewController+OWS.m index 8186b9025..143eb51ee 100644 --- a/SignalMessaging/categories/UIViewController+OWS.m +++ b/SignalMessaging/categories/UIViewController+OWS.m @@ -75,7 +75,7 @@ NS_ASSUME_NONNULL_BEGIN UIImage *backImage = [[UIImage imageNamed:(isRTL ? @"NavBarBackRTL" : @"NavBarBack")] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; OWSAssert(backImage); [backButton setImage:backImage forState:UIControlStateNormal]; - backButton.tintColor = UIColor.ows_navbarForegroundColor; + backButton.tintColor = UIColor.ows_navbarIconColor; backButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; diff --git a/SignalMessaging/utils/UIUtil.m b/SignalMessaging/utils/UIUtil.m index 24bb1adcc..57465ea87 100644 --- a/SignalMessaging/utils/UIUtil.m +++ b/SignalMessaging/utils/UIUtil.m @@ -27,11 +27,11 @@ + (void)setupSignalAppearence { UINavigationBar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor; - UINavigationBar.appearance.tintColor = UIColor.ows_navbarForegroundColor; + UINavigationBar.appearance.tintColor = UIColor.ows_navbarIconColor; UIToolbar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor; - UIToolbar.appearance.tintColor = UIColor.ows_navbarForegroundColor; + UIToolbar.appearance.tintColor = UIColor.ows_navbarIconColor; - UIBarButtonItem.appearance.tintColor = UIColor.ows_navbarForegroundColor; + UIBarButtonItem.appearance.tintColor = UIColor.ows_navbarIconColor; // Because our launch screen is blue, we specify the light content in our plist // but once the app has loaded we want to switch to dark. [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleDefault]; @@ -43,9 +43,7 @@ [[UIToolbar appearance] setTintColor:[UIColor ows_materialBlueColor]]; // If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored. - UINavigationBar.appearance.titleTextAttributes = @{ - NSForegroundColorAttributeName : UIColor.ows_navbarForegroundColor - }; + UINavigationBar.appearance.titleTextAttributes = @{ NSForegroundColorAttributeName : UIColor.ows_navbarTitleColor }; } @end From 249b0a32b2e854fcd32685f41808807387ca1d60 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 29 Jun 2018 17:56:00 -0600 Subject: [PATCH 12/13] long text view controller --- Signal/src/ViewControllers/LongTextViewController.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Signal/src/ViewControllers/LongTextViewController.swift b/Signal/src/ViewControllers/LongTextViewController.swift index 45fb333ab..11104e4b8 100644 --- a/Signal/src/ViewControllers/LongTextViewController.swift +++ b/Signal/src/ViewControllers/LongTextViewController.swift @@ -81,7 +81,6 @@ public class LongTextViewController: OWSViewController { messageTextView.autoPin(toTopLayoutGuideOf: self, withInset: 0) let footer = UIToolbar() - footer.barTintColor = UIColor.ows_materialBlue view.addSubview(footer) footer.autoPinWidthToSuperview(withMargin: 0) footer.autoPinEdge(.top, to: .bottom, of: messageTextView) From 4f94d5c5a9391a5a71138606e9ed99d3fc55d58c Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 29 Jun 2018 18:00:53 -0600 Subject: [PATCH 13/13] default value --- Signal/src/ViewControllers/MessageDetailViewController.swift | 1 - SignalMessaging/Views/OWSNavigationBar.swift | 3 --- 2 files changed, 4 deletions(-) diff --git a/Signal/src/ViewControllers/MessageDetailViewController.swift b/Signal/src/ViewControllers/MessageDetailViewController.swift index 784d3fd29..34eb91613 100644 --- a/Signal/src/ViewControllers/MessageDetailViewController.swift +++ b/Signal/src/ViewControllers/MessageDetailViewController.swift @@ -149,7 +149,6 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele if hasMediaAttachment { let footer = UIToolbar() - footer.barTintColor = UIColor.ows_materialBlue view.addSubview(footer) footer.autoPinWidthToSuperview(withMargin: 0) footer.autoPinEdge(.top, to: .bottom, of: scrollView) diff --git a/SignalMessaging/Views/OWSNavigationBar.swift b/SignalMessaging/Views/OWSNavigationBar.swift index 4c2837680..66b89a531 100644 --- a/SignalMessaging/Views/OWSNavigationBar.swift +++ b/SignalMessaging/Views/OWSNavigationBar.swift @@ -41,9 +41,6 @@ public class OWSNavigationBar: UINavigationBar { override init(frame: CGRect) { super.init(frame: frame) - self.isOpaque = false - self.isTranslucent = true - NotificationCenter.default.addObserver(self, selector: #selector(callDidChange), name: .OWSWindowManagerCallDidChange, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(didChangeStatusBarFrame), name: .UIApplicationDidChangeStatusBarFrame, object: nil) }