Merge branch 'charlesmchen/darkThemeReminders'

pull/1/head
Matthew Chen 7 years ago
commit 4b5021d8fd

@ -157,7 +157,10 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
#pragma GCC diagnostic ignored "-Wunused-result"
[ExperienceUpgradeFinder sharedManager];
#pragma GCC diagnostic pop
}
- (void)observeNotifications
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(signalAccountsDidChange:)
name:OWSContactsManagerSignalAccountsDidChangeNotification
@ -332,8 +335,6 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
action:@selector(pullToRefreshPerformed:)
forControlEvents:UIControlEventValueChanged];
[self.tableView insertSubview:pullToRefreshView atIndex:0];
[self updateReminderViews];
}
- (void)updateReminderViews
@ -349,6 +350,16 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
|| !self.deregisteredView.isHidden || !self.outageView.isHidden;
}
- (void)setHasVisibleReminders:(BOOL)hasVisibleReminders
{
if (_hasVisibleReminders == hasVisibleReminders) {
return;
}
_hasVisibleReminders = hasVisibleReminders;
// If the reminders show/hide, reload the table.
[self.tableView reloadData];
}
- (void)viewDidLoad
{
[super viewDidLoad];
@ -361,6 +372,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
[self updateMappings];
[self checkIfEmptyView];
[self updateReminderViews];
[self observeNotifications];
// because this uses the table data source, `tableViewSetup` must happen
// after mappings have been set up in `showInboxGrouping`
@ -411,6 +423,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
}
searchResultsController.view.hidden = YES;
[self updateReminderViews];
[self updateBarButtonItems];
[self applyTheme];
@ -802,6 +815,8 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
HomeViewControllerSection section = (HomeViewControllerSection)indexPath.section;
switch (section) {
case HomeViewControllerSectionReminders: {
OWSAssert(self.reminderStackView);
return self.reminderViewCell;
}
case HomeViewControllerSectionConversations: {

@ -61,12 +61,18 @@ class ReminderView: UIView {
}
func setupSubviews() {
let textColor: UIColor
let iconColor: UIColor
switch (mode) {
case .nag:
self.backgroundColor = UIColor.ows_reminderYellow
textColor = UIColor.ows_gray90
iconColor = UIColor.ows_gray60
case .explanation:
// TODO: Theme, review with design.
self.backgroundColor = Theme.offBackgroundColor
textColor = Theme.primaryColor
iconColor = Theme.secondaryColor
}
self.clipsToBounds = true
@ -85,7 +91,7 @@ class ReminderView: UIView {
// Label
label.font = UIFont.ows_dynamicTypeSubheadline
container.addArrangedSubview(label)
label.textColor = Theme.primaryColor
label.textColor = textColor
label.numberOfLines = 0
label.lineBreakMode = .byWordWrapping
@ -99,7 +105,7 @@ class ReminderView: UIView {
}
let iconView = UIImageView(image: iconImage.withRenderingMode(.alwaysTemplate))
iconView.contentMode = .scaleAspectFit
iconView.tintColor = Theme.secondaryColor
iconView.tintColor = iconColor
iconView.autoSetDimension(.width, toSize: 13)
container.addArrangedSubview(iconView)
}

Loading…
Cancel
Save