Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent 010c10cb0c
commit 4ac8100973

@ -211,6 +211,13 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
[SignalApp.sharedApp setHomeViewController:self]; [SignalApp.sharedApp setHomeViewController:self];
} }
UIStackView *reminderStackView = [UIStackView new];
reminderStackView.axis = UILayoutConstraintAxisVertical;
reminderStackView.spacing = 0;
[self.view addSubview:reminderStackView];
[reminderStackView autoPinWidthToSuperview];
[reminderStackView autoPinToTopLayoutGuideOfViewController:self withInset:0];
__weak HomeViewController *weakSelf = self; __weak HomeViewController *weakSelf = self;
ReminderView *deregisteredView = ReminderView *deregisteredView =
[ReminderView nagWithText:NSLocalizedString(@"DEREGISTRATION_WARNING", [ReminderView nagWithText:NSLocalizedString(@"DEREGISTRATION_WARNING",
@ -222,18 +229,14 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
} }
[RegistrationUtils showReregistrationUIFromViewController:strongSelf]; [RegistrationUtils showReregistrationUIFromViewController:strongSelf];
}]; }];
[self.view addSubview:deregisteredView]; [reminderStackView addArrangedSubview:deregisteredView];
[deregisteredView autoPinWidthToSuperview];
[deregisteredView autoPinToTopLayoutGuideOfViewController:self withInset:0];
self.hideDeregisteredViewConstraint = [deregisteredView autoSetDimension:ALDimensionHeight toSize:0]; self.hideDeregisteredViewConstraint = [deregisteredView autoSetDimension:ALDimensionHeight toSize:0];
self.hideDeregisteredViewConstraint.priority = UILayoutPriorityRequired; self.hideDeregisteredViewConstraint.priority = UILayoutPriorityRequired;
ReminderView *archiveReminderView = ReminderView *archiveReminderView =
[ReminderView explanationWithText:NSLocalizedString(@"INBOX_VIEW_ARCHIVE_MODE_REMINDER", [ReminderView explanationWithText:NSLocalizedString(@"INBOX_VIEW_ARCHIVE_MODE_REMINDER",
@"Label reminding the user that they are in archive mode.")]; @"Label reminding the user that they are in archive mode.")];
[self.view addSubview:archiveReminderView]; [reminderStackView addArrangedSubview:archiveReminderView];
[archiveReminderView autoPinWidthToSuperview];
[archiveReminderView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:deregisteredView];
self.hideArchiveReminderViewConstraint = [archiveReminderView autoSetDimension:ALDimensionHeight toSize:0]; self.hideArchiveReminderViewConstraint = [archiveReminderView autoSetDimension:ALDimensionHeight toSize:0];
self.hideArchiveReminderViewConstraint.priority = UILayoutPriorityRequired; self.hideArchiveReminderViewConstraint.priority = UILayoutPriorityRequired;
@ -243,9 +246,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
tapAction:^{ tapAction:^{
[[UIApplication sharedApplication] openSystemSettings]; [[UIApplication sharedApplication] openSystemSettings];
}]; }];
[self.view addSubview:missingContactsPermissionView]; [reminderStackView addArrangedSubview:missingContactsPermissionView];
[missingContactsPermissionView autoPinWidthToSuperview];
[missingContactsPermissionView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:archiveReminderView];
self.hideMissingContactsPermissionViewConstraint = self.hideMissingContactsPermissionViewConstraint =
[missingContactsPermissionView autoSetDimension:ALDimensionHeight toSize:0]; [missingContactsPermissionView autoSetDimension:ALDimensionHeight toSize:0];
self.hideMissingContactsPermissionViewConstraint.priority = UILayoutPriorityRequired; self.hideMissingContactsPermissionViewConstraint.priority = UILayoutPriorityRequired;
@ -259,7 +260,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
[self.view addSubview:self.tableView]; [self.view addSubview:self.tableView];
[self.tableView autoPinWidthToSuperview]; [self.tableView autoPinWidthToSuperview];
[self.tableView autoPinEdgeToSuperviewEdge:ALEdgeBottom]; [self.tableView autoPinEdgeToSuperviewEdge:ALEdgeBottom];
[self.tableView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:missingContactsPermissionView]; [self.tableView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:reminderStackView];
self.tableView.rowHeight = UITableViewAutomaticDimension; self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 60; self.tableView.estimatedRowHeight = 60;
@ -825,11 +826,8 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
// Constrain to cell margins. // Constrain to cell margins.
[stackView autoPinEdgeToSuperviewMargin:ALEdgeLeading relation:NSLayoutRelationGreaterThanOrEqual]; [stackView autoPinEdgeToSuperviewMargin:ALEdgeLeading relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeTrailing relation:NSLayoutRelationGreaterThanOrEqual]; [stackView autoPinEdgeToSuperviewMargin:ALEdgeTrailing relation:NSLayoutRelationGreaterThanOrEqual];
// Ensure that the cell's contents never overflow the cell bounds. [stackView autoPinEdgeToSuperviewMargin:ALEdgeTop];
// We pin to the superview _edge_ and not _margin_ for the purposes [stackView autoPinEdgeToSuperviewMargin:ALEdgeBottom];
// of overflow, so that changes to the margins do not trip these safe guards.
[stackView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:0 relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:0 relation:NSLayoutRelationGreaterThanOrEqual];
return cell; return cell;
} }

@ -89,12 +89,7 @@ class ReminderView: UIView {
// Margin: top and bottom 12 left and right 16. // Margin: top and bottom 12 left and right 16.
// Label // Label
switch (mode) { label.font = UIFont.ows_dynamicTypeSubheadline
case .nag:
label.font = UIFont.ows_dynamicTypeFootnote
case .explanation:
label.font = UIFont.ows_dynamicTypeSubheadline
}
container.addSubview(label) container.addSubview(label)
label.textColor = UIColor.black.withAlphaComponent(0.9) label.textColor = UIColor.black.withAlphaComponent(0.9)
label.numberOfLines = 0 label.numberOfLines = 0

Loading…
Cancel
Save