From 8862f9a5311f70040707cac8201ab250ec982044 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 12 Jul 2018 18:38:55 -0400 Subject: [PATCH] Refine views. --- .../AppSettings/AppSettingsViewController.m | 2 +- .../ViewControllers/HomeView/HomeViewCell.m | 10 ++--- .../HomeView/HomeViewController.m | 4 +- .../NewContactThreadViewController.m | 43 ++++++++++++++++--- .../ViewControllers/NewGroupViewController.m | 4 +- .../OWS2FASettingsViewController.m | 4 +- .../OWSConversationSettingsViewController.m | 4 +- Signal/src/views/PinEntryView.m | 4 +- Signal/src/views/ReminderView.swift | 4 +- .../ViewControllers/OWSTableViewController.h | 1 + .../ViewControllers/OWSTableViewController.m | 14 +++--- SignalMessaging/Views/ContactCellView.m | 19 ++++---- SignalMessaging/Views/ContactTableViewCell.m | 3 ++ SignalMessaging/categories/UIColor+OWS.h | 7 +-- SignalMessaging/categories/UIColor+OWS.m | 8 +++- SignalMessaging/contacts/OWSContactsManager.m | 4 +- .../contacts/SelectRecipientViewController.m | 4 +- 17 files changed, 93 insertions(+), 46 deletions(-) diff --git a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m index 480673d7f..b3ce0a4b3 100644 --- a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m +++ b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m @@ -316,7 +316,7 @@ NSString *_Nullable localProfileName = [OWSProfileManager.sharedManager localProfileName]; if (localProfileName.length > 0) { titleLabel.text = localProfileName; - titleLabel.textColor = [UIColor ows_themeForegroundColor]; + titleLabel.textColor = [UIColor ows_themePrimaryColor]; titleLabel.font = [UIFont ows_dynamicTypeTitle2Font]; } else { titleLabel.text = NSLocalizedString( diff --git a/Signal/src/ViewControllers/HomeView/HomeViewCell.m b/Signal/src/ViewControllers/HomeView/HomeViewCell.m index f9ecd330c..11250f743 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewCell.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewCell.m @@ -228,7 +228,7 @@ NS_ASSUME_NONNULL_BEGIN UIColor *textColor = [UIColor ows_themeSecondaryColor]; if (hasUnreadMessages && overrideSnippet == nil) { - textColor = [UIColor ows_themeForegroundColor]; + textColor = [UIColor ows_themePrimaryColor]; self.dateTimeLabel.font = self.dateTimeFont.ows_mediumWeight; } else { self.dateTimeLabel.font = self.dateTimeFont; @@ -366,7 +366,7 @@ NS_ASSUME_NONNULL_BEGIN @"A label for conversations with blocked users.") attributes:@{ NSFontAttributeName : self.snippetFont.ows_mediumWeight, - NSForegroundColorAttributeName : [UIColor ows_themeForegroundColor], + NSForegroundColorAttributeName : [UIColor ows_themePrimaryColor], }]]; } else { if ([thread isMuted]) { @@ -375,7 +375,7 @@ NS_ASSUME_NONNULL_BEGIN attributes:@{ NSFontAttributeName : [UIFont ows_elegantIconsFont:9.f], NSForegroundColorAttributeName : - (hasUnreadMessages ? [UIColor ows_themeForegroundColor] + (hasUnreadMessages ? [UIColor ows_themePrimaryColor] : [UIColor ows_themeSecondaryColor]), }]]; } @@ -388,7 +388,7 @@ NS_ASSUME_NONNULL_BEGIN (hasUnreadMessages ? self.snippetFont.ows_mediumWeight : self.snippetFont), NSForegroundColorAttributeName : - (hasUnreadMessages ? [UIColor ows_themeForegroundColor] + (hasUnreadMessages ? [UIColor ows_themePrimaryColor] : [UIColor ows_themeSecondaryColor]), }]]; } @@ -491,7 +491,7 @@ NS_ASSUME_NONNULL_BEGIN OWSAssertIsOnMainThread(); self.nameLabel.font = self.nameFont; - self.nameLabel.textColor = [UIColor ows_themeForegroundColor]; + self.nameLabel.textColor = [UIColor ows_themePrimaryColor]; ThreadViewModel *thread = self.thread; if (thread == nil) { diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index ba50c92be..d043a35e6 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -822,7 +822,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations label.text = NSLocalizedString(@"HOME_VIEW_ARCHIVED_CONVERSATIONS", @"Label for 'archived conversations' button."); label.textAlignment = NSTextAlignmentCenter; label.font = [UIFont ows_dynamicTypeBodyFont]; - label.textColor = UIColor.ows_themeForegroundColor; + label.textColor = UIColor.ows_themePrimaryColor; UIStackView *stackView = [UIStackView new]; stackView.axis = UILayoutConstraintAxisHorizontal; @@ -1449,7 +1449,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations value:[UIFont ows_regularFontWithSize:14.f] range:NSMakeRange(firstLine.length + 1, secondLine.length)]; [fullLabelString addAttribute:NSForegroundColorAttributeName - value:UIColor.ows_themeForegroundColor + value:UIColor.ows_themePrimaryColor range:NSMakeRange(0, firstLine.length)]; // TODO: Theme, Review with design. [fullLabelString addAttribute:NSForegroundColorAttributeName diff --git a/Signal/src/ViewControllers/NewContactThreadViewController.m b/Signal/src/ViewControllers/NewContactThreadViewController.m index 513ac630e..16e8cd395 100644 --- a/Signal/src/ViewControllers/NewContactThreadViewController.m +++ b/Signal/src/ViewControllers/NewContactThreadViewController.m @@ -75,7 +75,7 @@ NS_ASSUME_NONNULL_BEGIN { [super loadView]; - self.view.backgroundColor = UIColor.whiteColor; + self.view.backgroundColor = UIColor.ows_themeBackgroundColor; _contactsViewHelper = [[ContactsViewHelper alloc] initWithDelegate:self]; _conversationSearcher = [ConversationSearcher shared]; _nonContactAccountSet = [NSMutableSet set]; @@ -102,7 +102,12 @@ NS_ASSUME_NONNULL_BEGIN searchBar.searchBarStyle = UISearchBarStyleMinimal; searchBar.delegate = self; searchBar.placeholder = NSLocalizedString(@"SEARCH_BYNAMEORNUMBER_PLACEHOLDER_TEXT", @""); - searchBar.backgroundColor = [UIColor whiteColor]; + searchBar.backgroundColor = [UIColor ows_themeBackgroundColor]; + if (UIColor.isThemeEnabled) { + searchBar.barStyle = UIBarStyleBlack; + } else { + searchBar.barStyle = UIBarStyleDefault; + } [searchBar sizeToFit]; _tableViewController = [OWSTableViewController new]; @@ -139,6 +144,18 @@ NS_ASSUME_NONNULL_BEGIN [self.tableViewController.tableView insertSubview:pullToRefreshView atIndex:0]; [self updateTableContents]; + + [self applyTheme]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(themeDidChange:) + name:NSNotificationNameThemeDidChange + object:nil]; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; } - (void)pullToRefreshPerformed:(UIRefreshControl *)refreshControl @@ -166,7 +183,7 @@ NS_ASSUME_NONNULL_BEGIN - (UIView *)createNoSignalContactsView { UIView *view = [UIView new]; - view.backgroundColor = [UIColor whiteColor]; + view.backgroundColor = [UIColor ows_themeBackgroundColor]; UIView *contents = [UIView new]; [view addSubview:contents]; @@ -188,7 +205,7 @@ NS_ASSUME_NONNULL_BEGIN UILabel *titleLabel = [UILabel new]; titleLabel.text = NSLocalizedString( @"EMPTY_CONTACTS_LABEL_LINE1", "Full width label displayed when attempting to compose message"); - titleLabel.textColor = [UIColor blackColor]; + titleLabel.textColor = [UIColor ows_themePrimaryColor]; titleLabel.font = [UIFont ows_mediumFontWithSize:ScaleFromIPhone5To7Plus(17.f, 20.f)]; titleLabel.textAlignment = NSTextAlignmentCenter; titleLabel.lineBreakMode = NSLineBreakByWordWrapping; @@ -201,7 +218,7 @@ NS_ASSUME_NONNULL_BEGIN UILabel *subtitleLabel = [UILabel new]; subtitleLabel.text = NSLocalizedString( @"EMPTY_CONTACTS_LABEL_LINE2", "Full width label displayed when attempting to compose message"); - subtitleLabel.textColor = [UIColor colorWithWhite:0.32f alpha:1.f]; + subtitleLabel.textColor = [UIColor ows_themeSecondaryColor]; subtitleLabel.font = [UIFont ows_regularFontWithSize:ScaleFromIPhone5To7Plus(12.f, 14.f)]; subtitleLabel.textAlignment = NSTextAlignmentCenter; subtitleLabel.lineBreakMode = NSLineBreakByWordWrapping; @@ -993,6 +1010,22 @@ NS_ASSUME_NONNULL_BEGIN } } +#pragma mark - Theme + +- (void)themeDidChange:(id)notification +{ + OWSAssertIsOnMainThread(); + + [self applyTheme]; +} + +- (void)applyTheme +{ + OWSAssertIsOnMainThread(); + + self.view.backgroundColor = UIColor.ows_themeBackgroundColor; +} + @end NS_ASSUME_NONNULL_END diff --git a/Signal/src/ViewControllers/NewGroupViewController.m b/Signal/src/ViewControllers/NewGroupViewController.m index 2e1a73c5e..b2ca9e28c 100644 --- a/Signal/src/ViewControllers/NewGroupViewController.m +++ b/Signal/src/ViewControllers/NewGroupViewController.m @@ -137,7 +137,7 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68; firstSectionHeader.userInteractionEnabled = YES; [firstSectionHeader addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(headerWasTapped:)]]; - firstSectionHeader.backgroundColor = [UIColor whiteColor]; + firstSectionHeader.backgroundColor = [UIColor ows_themeBackgroundColor]; UIView *threadInfoView = [UIView new]; [firstSectionHeader addSubview:threadInfoView]; [threadInfoView autoPinWidthToSuperviewWithMargin:16.f]; @@ -155,7 +155,7 @@ const NSUInteger kNewGroupViewControllerAvatarWidth = 68; UITextField *groupNameTextField = [UITextField new]; _groupNameTextField = groupNameTextField; - groupNameTextField.textColor = [UIColor blackColor]; + groupNameTextField.textColor = [UIColor ows_themePrimaryColor]; groupNameTextField.font = [UIFont ows_dynamicTypeTitle2Font]; groupNameTextField.placeholder = NSLocalizedString(@"NEW_GROUP_NAMEGROUP_REQUEST_DEFAULT", @"Placeholder text for group name field"); diff --git a/Signal/src/ViewControllers/OWS2FASettingsViewController.m b/Signal/src/ViewControllers/OWS2FASettingsViewController.m index 5d84b16bf..3a11de364 100644 --- a/Signal/src/ViewControllers/OWS2FASettingsViewController.m +++ b/Signal/src/ViewControllers/OWS2FASettingsViewController.m @@ -99,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN - (UILabel *)createLabelWithText:(NSString *)text { UILabel *label = [UILabel new]; - label.textColor = [UIColor ows_themeForegroundColor]; + label.textColor = [UIColor ows_themePrimaryColor]; label.text = text; label.font = [UIFont ows_regularFontWithSize:ScaleFromIPhone5To7Plus(14.f, 16.f)]; label.numberOfLines = 0; @@ -112,7 +112,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)createPinTextfield { self.pinTextfield = [UITextField new]; - self.pinTextfield.textColor = [UIColor ows_themeForegroundColor]; + self.pinTextfield.textColor = [UIColor ows_themePrimaryColor]; self.pinTextfield.font = [UIFont ows_mediumFontWithSize:ScaleFromIPhone5To7Plus(30.f, 36.f)]; self.pinTextfield.textAlignment = NSTextAlignmentCenter; self.pinTextfield.keyboardType = UIKeyboardTypeNumberPad; diff --git a/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m b/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m index b79a447fe..e36e62cef 100644 --- a/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m +++ b/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m @@ -514,11 +514,11 @@ const CGFloat kIconViewLength = 24; itemWithCustomCellBlock:^{ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil]; + [OWSTableItem configureCell:cell]; OWSConversationSettingsViewController *strongSelf = weakSelf; OWSCAssert(strongSelf); cell.preservesSuperviewLayoutMargins = YES; cell.contentView.preservesSuperviewLayoutMargins = YES; - cell.backgroundColor = [UIColor ows_themeBackgroundColor]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; UIImageView *iconView = [strongSelf viewForIconWithName:@"table_ic_notification_sound"]; @@ -553,11 +553,11 @@ const CGFloat kIconViewLength = 24; itemWithCustomCellBlock:^{ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil]; + [OWSTableItem configureCell:cell]; OWSConversationSettingsViewController *strongSelf = weakSelf; OWSCAssert(strongSelf); cell.preservesSuperviewLayoutMargins = YES; cell.contentView.preservesSuperviewLayoutMargins = YES; - cell.backgroundColor = [UIColor ows_themeBackgroundColor]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; UIImageView *iconView = [strongSelf viewForIconWithName:@"table_ic_mute_thread"]; diff --git a/Signal/src/views/PinEntryView.m b/Signal/src/views/PinEntryView.m index 5e7f29f4c..25923f034 100644 --- a/Signal/src/views/PinEntryView.m +++ b/Signal/src/views/PinEntryView.m @@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN - (UILabel *)createLabelWithText:(nullable NSString *)text { UILabel *label = [UILabel new]; - label.textColor = [UIColor ows_themeForegroundColor]; + label.textColor = [UIColor ows_themePrimaryColor]; label.text = text; label.font = self.labelFont; label.numberOfLines = 0; @@ -65,7 +65,7 @@ NS_ASSUME_NONNULL_BEGIN self.pinTextfield = [UITextField new]; } - self.pinTextfield.textColor = [UIColor ows_themeForegroundColor]; + self.pinTextfield.textColor = [UIColor ows_themePrimaryColor]; self.pinTextfield.font = [UIFont ows_mediumFontWithSize:ScaleFromIPhone5To7Plus(30.f, 36.f)]; self.pinTextfield.textAlignment = NSTextAlignmentCenter; self.pinTextfield.keyboardType = UIKeyboardTypeNumberPad; diff --git a/Signal/src/views/ReminderView.swift b/Signal/src/views/ReminderView.swift index 7981af096..5298ab3d3 100644 --- a/Signal/src/views/ReminderView.swift +++ b/Signal/src/views/ReminderView.swift @@ -88,7 +88,7 @@ class ReminderView: UIView { // Label label.font = UIFont.ows_dynamicTypeSubheadline container.addArrangedSubview(label) - label.textColor = UIColor.ows_themeForeground() + label.textColor = UIColor.ows_themePrimary label.numberOfLines = 0 label.lineBreakMode = .byWordWrapping @@ -102,7 +102,7 @@ class ReminderView: UIView { } let iconView = UIImageView(image: iconImage.withRenderingMode(.alwaysTemplate)) iconView.contentMode = .scaleAspectFit - iconView.tintColor = UIColor.ows_themeSecondary() + iconView.tintColor = UIColor.ows_themeSecondary iconView.autoSetDimension(.width, toSize: 13) container.addArrangedSubview(iconView) } diff --git a/SignalMessaging/ViewControllers/OWSTableViewController.h b/SignalMessaging/ViewControllers/OWSTableViewController.h index 0aa07dd34..c90133e84 100644 --- a/SignalMessaging/ViewControllers/OWSTableViewController.h +++ b/SignalMessaging/ViewControllers/OWSTableViewController.h @@ -53,6 +53,7 @@ typedef UITableViewCell *_Nonnull (^OWSTableCustomCellBlock)(void); @property (nonatomic, weak) UIViewController *tableViewController; + (UITableViewCell *)newCell; ++ (void)configureCell:(UITableViewCell *)cell; + (OWSTableItem *)itemWithTitle:(NSString *)title actionBlock:(nullable OWSTableActionBlock)actionBlock; diff --git a/SignalMessaging/ViewControllers/OWSTableViewController.m b/SignalMessaging/ViewControllers/OWSTableViewController.m index 4a749b0e3..43a5990cf 100644 --- a/SignalMessaging/ViewControllers/OWSTableViewController.m +++ b/SignalMessaging/ViewControllers/OWSTableViewController.m @@ -101,16 +101,20 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f; + (UITableViewCell *)newCell { UITableViewCell *cell = [UITableViewCell new]; + [self configureCell:cell]; + return cell; +} + ++ (void)configureCell:(UITableViewCell *)cell +{ cell.backgroundColor = [UIColor ows_themeBackgroundColor]; cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f]; - cell.textLabel.textColor = [UIColor ows_themeForegroundColor]; + cell.textLabel.textColor = [UIColor ows_themePrimaryColor]; UIView *selectedBackgroundView = [UIView new]; selectedBackgroundView.backgroundColor = [(UIColor.isThemeEnabled ? [UIColor ows_whiteColor] : [UIColor ows_blackColor]) colorWithAlphaComponent:0.08]; cell.selectedBackgroundView = selectedBackgroundView; - - return cell; } + (OWSTableItem *)itemWithTitle:(NSString *)title actionBlock:(nullable OWSTableActionBlock)actionBlock @@ -210,10 +214,8 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f; item.customCellBlock = ^{ UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"UITableViewCellStyleValue1"]; - cell.backgroundColor = [UIColor ows_themeBackgroundColor]; + [OWSTableItem configureCell:cell]; cell.textLabel.text = text; - cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f]; - cell.textLabel.textColor = [UIColor ows_themeForegroundColor]; cell.detailTextLabel.text = detailText; [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; return cell; diff --git a/SignalMessaging/Views/ContactCellView.m b/SignalMessaging/Views/ContactCellView.m index dbb9d15f6..88d9a79bc 100644 --- a/SignalMessaging/Views/ContactCellView.m +++ b/SignalMessaging/Views/ContactCellView.m @@ -58,18 +58,14 @@ const CGFloat kContactCellAvatarTextMargin = 12; self.nameLabel = [UILabel new]; self.nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; - self.nameLabel.textColor = [UIColor blackColor]; self.profileNameLabel = [UILabel new]; self.profileNameLabel.lineBreakMode = NSLineBreakByTruncatingTail; - self.profileNameLabel.textColor = [UIColor grayColor]; self.subtitleLabel = [UILabel new]; - self.subtitleLabel.textColor = [UIColor ows_darkGrayColor]; self.accessoryLabel = [[UILabel alloc] init]; self.accessoryLabel.textAlignment = NSTextAlignmentRight; - self.accessoryLabel.textColor = [UIColor colorWithWhite:0.5f alpha:1.f]; self.accessoryViewContainer = [UIView containerView]; @@ -91,15 +87,20 @@ const CGFloat kContactCellAvatarTextMargin = 12; [self addArrangedSubview:self.nameContainerView]; [self addArrangedSubview:self.accessoryViewContainer]; - [self configureFonts]; + [self configureFontsAndColors]; } -- (void)configureFonts +- (void)configureFontsAndColors { self.nameLabel.font = [UIFont ows_dynamicTypeBodyFont]; self.profileNameLabel.font = [UIFont ows_regularFontWithSize:11.f]; self.subtitleLabel.font = [UIFont ows_regularFontWithSize:11.f]; self.accessoryLabel.font = [UIFont ows_mediumFontWithSize:13.f]; + + self.nameLabel.textColor = [UIColor ows_themePrimaryColor]; + self.profileNameLabel.textColor = [UIColor ows_themeSecondaryColor]; + self.subtitleLabel.textColor = [UIColor ows_themeSecondaryColor]; + self.accessoryLabel.textColor = [UIColor colorWithWhite:0.5f alpha:1.f]; } - (void)configureWithSignalAccount:(SignalAccount *)signalAccount contactsManager:(OWSContactsManager *)contactsManager @@ -113,7 +114,7 @@ const CGFloat kContactCellAvatarTextMargin = 12; OWSAssert(contactsManager); // Update fonts to reflect changes to dynamic type. - [self configureFonts]; + [self configureFontsAndColors]; self.recipientId = recipientId; self.contactsManager = contactsManager; @@ -143,7 +144,7 @@ const CGFloat kContactCellAvatarTextMargin = 12; self.thread = thread; // Update fonts to reflect changes to dynamic type. - [self configureFonts]; + [self configureFontsAndColors]; self.contactsManager = contactsManager; @@ -155,7 +156,7 @@ const CGFloat kContactCellAvatarTextMargin = 12; NSAttributedString *attributedText = [[NSAttributedString alloc] initWithString:threadName attributes:@{ - NSForegroundColorAttributeName : [UIColor blackColor], + NSForegroundColorAttributeName : [UIColor ows_themePrimaryColor], }]; self.nameLabel.attributedText = attributedText; diff --git a/SignalMessaging/Views/ContactTableViewCell.m b/SignalMessaging/Views/ContactTableViewCell.m index 151937bb6..606b854d6 100644 --- a/SignalMessaging/Views/ContactTableViewCell.m +++ b/SignalMessaging/Views/ContactTableViewCell.m @@ -4,6 +4,8 @@ #import "ContactTableViewCell.h" #import "ContactCellView.h" +#import "OWSTableViewController.h" +#import "UIColor+OWS.h" #import "UIFont+OWS.h" #import "UIView+OWS.h" #import @@ -44,6 +46,7 @@ NS_ASSUME_NONNULL_BEGIN self.preservesSuperviewLayoutMargins = YES; self.contentView.preservesSuperviewLayoutMargins = YES; + [OWSTableItem configureCell:self]; self.cellView = [ContactCellView new]; [self.contentView addSubview:self.cellView]; diff --git a/SignalMessaging/categories/UIColor+OWS.h b/SignalMessaging/categories/UIColor+OWS.h index c31fb084d..8647a54d5 100644 --- a/SignalMessaging/categories/UIColor+OWS.h +++ b/SignalMessaging/categories/UIColor+OWS.h @@ -90,9 +90,10 @@ extern NSString *const NSNotificationNameThemeDidChange; + (void)setIsThemeEnabled:(BOOL)value; #endif -+ (UIColor *)ows_themeBackgroundColor; -+ (UIColor *)ows_themeForegroundColor; -+ (UIColor *)ows_themeSecondaryColor; +@property (class, readonly, nonatomic) UIColor *ows_themeBackgroundColor; +@property (class, readonly, nonatomic) UIColor *ows_themePrimaryColor; +@property (class, readonly, nonatomic) UIColor *ows_themeSecondaryColor; +@property (class, readonly, nonatomic) UIColor *ows_themeBoldColor; @end diff --git a/SignalMessaging/categories/UIColor+OWS.m b/SignalMessaging/categories/UIColor+OWS.m index bbf0c9b35..bebc517fb 100644 --- a/SignalMessaging/categories/UIColor+OWS.m +++ b/SignalMessaging/categories/UIColor+OWS.m @@ -384,7 +384,7 @@ NSString *const UIColorKeyThemeEnabled = @"UIColorKeyThemeEnabled"; return (UIColor.isThemeEnabled ? UIColor.ows_blackColor : UIColor.ows_whiteColor); } -+ (UIColor *)ows_themeForegroundColor ++ (UIColor *)ows_themePrimaryColor { // TODO: Theme, Review with design. return (UIColor.isThemeEnabled ? UIColor.ows_whiteColor : UIColor.ows_light90Color); @@ -396,6 +396,12 @@ NSString *const UIColorKeyThemeEnabled = @"UIColorKeyThemeEnabled"; return (UIColor.isThemeEnabled ? UIColor.ows_dark60Color : UIColor.ows_light60Color); } ++ (UIColor *)ows_themeBoldColor +{ + // TODO: Review with design. + return (UIColor.isThemeEnabled ? UIColor.ows_whiteColor : UIColor.blackColor); +} + @end NS_ASSUME_NONNULL_END diff --git a/SignalMessaging/contacts/OWSContactsManager.m b/SignalMessaging/contacts/OWSContactsManager.m index da1d9864b..ed7ddee40 100644 --- a/SignalMessaging/contacts/OWSContactsManager.m +++ b/SignalMessaging/contacts/OWSContactsManager.m @@ -762,9 +762,9 @@ NSString *const OWSContactsManagerKeyNextFullIntersectionDate = @"OWSContactsMan UIFont *boldFont = [UIFont ows_mediumFontWithSize:font.pointSize]; NSDictionary *boldFontAttributes = - @{ NSFontAttributeName : boldFont, NSForegroundColorAttributeName : [UIColor blackColor] }; + @{ NSFontAttributeName : boldFont, NSForegroundColorAttributeName : [UIColor ows_themeBoldColor] }; NSDictionary *normalFontAttributes = - @{ NSFontAttributeName : font, NSForegroundColorAttributeName : [UIColor ows_darkGrayColor] }; + @{ NSFontAttributeName : font, NSForegroundColorAttributeName : [UIColor ows_themePrimaryColor] }; NSDictionary *firstNameAttributes = (self.shouldSortByGivenName ? boldFontAttributes : normalFontAttributes); NSDictionary *lastNameAttributes diff --git a/SignalMessaging/contacts/SelectRecipientViewController.m b/SignalMessaging/contacts/SelectRecipientViewController.m index d7f6469cb..5d664c3dd 100644 --- a/SignalMessaging/contacts/SelectRecipientViewController.m +++ b/SignalMessaging/contacts/SelectRecipientViewController.m @@ -108,7 +108,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien { UILabel *countryCodeLabel = [UILabel new]; countryCodeLabel.font = [UIFont ows_mediumFontWithSize:18.f]; - countryCodeLabel.textColor = [UIColor ows_themeForegroundColor]; + countryCodeLabel.textColor = [UIColor ows_themePrimaryColor]; countryCodeLabel.text = NSLocalizedString(@"REGISTRATION_DEFAULT_COUNTRY_NAME", @"Label for the country code field"); return countryCodeLabel; @@ -133,7 +133,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien { UILabel *phoneNumberLabel = [UILabel new]; phoneNumberLabel.font = [UIFont ows_mediumFontWithSize:18.f]; - phoneNumberLabel.textColor = [UIColor ows_themeForegroundColor]; + phoneNumberLabel.textColor = [UIColor ows_themePrimaryColor]; phoneNumberLabel.text = NSLocalizedString(@"REGISTRATION_PHONENUMBER_BUTTON", @"Label for the phone number textfield"); return phoneNumberLabel;