Centralize translucency configuration

// FREEBIE
pull/1/head
Michael Kirk 8 years ago committed by Matthew Chen
parent 12c98f4340
commit 33eb4c38cd

@ -80,7 +80,6 @@
OWSAssert([self.navigationController isKindOfClass:[OWSNavigationController class]]); OWSAssert([self.navigationController isKindOfClass:[OWSNavigationController class]]);
[self.navigationController.navigationBar setTranslucent:NO];
self.navigationItem.leftBarButtonItem = self.navigationItem.leftBarButtonItem =
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop
target:self target:self

@ -47,12 +47,6 @@ NS_ASSUME_NONNULL_BEGIN
[self updateTableContents]; [self updateTableContents];
} }
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
}
#pragma mark - Table view data source #pragma mark - Table view data source
- (void)updateTableContents - (void)updateTableContents

@ -31,7 +31,6 @@ NS_ASSUME_NONNULL_BEGIN
@"CENSORSHIP_CIRCUMVENTION_COUNTRY_VIEW_TITLE", @"Title for the 'censorship circumvention country' view."); @"CENSORSHIP_CIRCUMVENTION_COUNTRY_VIEW_TITLE", @"Title for the 'censorship circumvention country' view.");
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
[self.navigationController.navigationBar setTranslucent:NO];
[self createViews]; [self createViews];
} }

@ -500,11 +500,8 @@ typedef enum : NSUInteger {
{ {
[super viewDidLoad]; [super viewDidLoad];
// self.topLayoutGuide
[self createContents]; [self createContents];
[self.navigationController.navigationBar setTranslucent:NO];
[self registerCellClasses]; [self registerCellClasses];
[self createConversationScrollButtons]; [self createConversationScrollButtons];
@ -527,8 +524,6 @@ typedef enum : NSUInteger {
{ {
[super loadView]; [super loadView];
// extendedLayoutIncludesOpaqueBars
// self.extendedLayoutIncludesOpaqueBars = YES;
self.view.backgroundColor = [UIColor ows_toolbarBackgroundColor]; self.view.backgroundColor = [UIColor ows_toolbarBackgroundColor];
} }

@ -252,7 +252,6 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
- (void)viewDidLoad - (void)viewDidLoad
{ {
[super viewDidLoad]; [super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
self.editingDbConnection = OWSPrimaryStorage.sharedManager.newDatabaseConnection; self.editingDbConnection = OWSPrimaryStorage.sharedManager.newDatabaseConnection;

@ -269,8 +269,6 @@ NS_ASSUME_NONNULL_BEGIN
// a message. // a message.
[self.contactsViewHelper.contactsManager requestSystemContactsOnce]; [self.contactsViewHelper.contactsManager requestSystemContactsOnce];
[self.navigationController.navigationBar setTranslucent:NO];
[self showContactAppropriateViews]; [self showContactAppropriateViews];
} }

@ -420,13 +420,6 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68;
#pragma mark - Methods #pragma mark - Methods
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
}
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated
{ {
[super viewDidAppear:animated]; [super viewDidAppear:animated];

@ -75,7 +75,6 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
{ {
[super loadView]; [super loadView];
[self.navigationController.navigationBar setTranslucent:NO];
self.title = NSLocalizedString(@"PROFILE_VIEW_TITLE", @"Title for the profile view."); self.title = NSLocalizedString(@"PROFILE_VIEW_TITLE", @"Title for the profile view.");
_avatarViewHelper = [AvatarViewHelper new]; _avatarViewHelper = [AvatarViewHelper new];
@ -94,7 +93,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
UIView *contentView = [UIView containerView]; UIView *contentView = [UIView containerView];
contentView.backgroundColor = [UIColor whiteColor]; contentView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:contentView]; [self.view addSubview:contentView];
[contentView autoPinEdgeToSuperviewEdge:ALEdgeTop]; [contentView autoPinToTopLayoutGuideOfViewController:self withInset:0];
[contentView autoPinWidthToSuperview]; [contentView autoPinWidthToSuperview];
const CGFloat fontSizePoints = ScaleFromIPhone5To7Plus(16.f, 20.f); const CGFloat fontSizePoints = ScaleFromIPhone5To7Plus(16.f, 20.f);

@ -97,11 +97,6 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssert([self.navigationController isKindOfClass:[OWSNavigationController class]]); OWSAssert([self.navigationController isKindOfClass:[OWSNavigationController class]]);
// HACK otherwise CNContactViewController Navbar is shown as black.
// RADAR rdar://28433898 http://www.openradar.me/28433898
// CNContactViewController incompatible with opaque navigation bar
[self.navigationController.navigationBar setTranslucent:YES];
self.title = _thread.groupModel.groupName; self.title = _thread.groupModel.groupName;
[self updateTableContents]; [self updateTableContents];

@ -113,7 +113,7 @@ NS_ASSUME_NONNULL_BEGIN
[self.view addSubview:firstSection]; [self.view addSubview:firstSection];
[firstSection autoSetDimension:ALDimensionHeight toSize:100.f]; [firstSection autoSetDimension:ALDimensionHeight toSize:100.f];
[firstSection autoPinWidthToSuperview]; [firstSection autoPinWidthToSuperview];
[firstSection autoPinEdgeToSuperviewEdge:ALEdgeTop]; [firstSection autoPinToTopLayoutGuideOfViewController:self withInset:0];
_tableViewController = [OWSTableViewController new]; _tableViewController = [OWSTableViewController new];
_tableViewController.delegate = self; _tableViewController.delegate = self;
@ -125,13 +125,6 @@ NS_ASSUME_NONNULL_BEGIN
[self updateTableContents]; [self updateTableContents];
} }
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
}
- (void)setHasUnsavedChanges:(BOOL)hasUnsavedChanges - (void)setHasUnsavedChanges:(BOOL)hasUnsavedChanges
{ {
_hasUnsavedChanges = hasUnsavedChanges; _hasUnsavedChanges = hasUnsavedChanges;

@ -16,6 +16,8 @@ class SignalNavigationBar: UINavigationBar {
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
self.isTranslucent = false
// TODO better place to observe? // TODO better place to observe?
NotificationCenter.default.addObserver(forName: .OWSWindowManagerCallDidChange, object: nil, queue: nil) { _ in NotificationCenter.default.addObserver(forName: .OWSWindowManagerCallDidChange, object: nil, queue: nil) { _ in
Logger.debug("\(self.logTag) in \(#function) OWSWindowManagerCallDidChange") Logger.debug("\(self.logTag) in \(#function) OWSWindowManagerCallDidChange")

@ -463,13 +463,6 @@ NSString *const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kOWSTableCellIdentifier]; [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kOWSTableCellIdentifier];
} }
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
}
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
{ {
[super viewWillAppear:animated]; [super viewWillAppear:animated];

@ -26,7 +26,6 @@
[super loadView]; [super loadView];
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
[self.navigationController.navigationBar setTranslucent:NO];
self.title = NSLocalizedString(@"COUNTRYCODE_SELECT_TITLE", @""); self.title = NSLocalizedString(@"COUNTRYCODE_SELECT_TITLE", @"");
self.countryCodes = [PhoneNumberUtil countryCodesForSearchTerm:nil]; self.countryCodes = [PhoneNumberUtil countryCodesForSearchTerm:nil];

@ -55,7 +55,6 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
[super loadView]; [super loadView];
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
[self.navigationController.navigationBar setTranslucent:NO];
_contactsViewHelper = [[ContactsViewHelper alloc] initWithDelegate:self]; _contactsViewHelper = [[ContactsViewHelper alloc] initWithDelegate:self];

@ -81,12 +81,6 @@ NS_ASSUME_NONNULL_BEGIN
[self updateTableContents]; [self updateTableContents];
} }
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController.navigationBar setTranslucent:NO];
}
- (void)createViews - (void)createViews
{ {
OWSAssert(self.selectThreadViewDelegate); OWSAssert(self.selectThreadViewDelegate);

Loading…
Cancel
Save