Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent 581347a7fb
commit fa8a07abf1

@ -236,7 +236,6 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView
owsFail("\(logTag) in \(#function) cell had unexpected type")
return UITableViewCell()
}
OWSTableItem.configureCell(cell)
let dataSource = filteredSections
let cnContact = dataSource[indexPath.section][indexPath.row]

@ -115,7 +115,6 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssert(self.viewItem);
OWSAssert([self.viewItem.interaction isKindOfClass:[OWSContactOffersInteraction class]]);
// [OWSTableItem configureCell:self];
self.backgroundColor = [Theme backgroundColor];
[self configureFonts];

@ -49,6 +49,7 @@ typedef void (^SystemMessageActionBlock)(void);
@property (nonatomic) UILabel *titleLabel;
@property (nonatomic) UIButton *button;
@property (nonatomic) UIStackView *vStackView;
@property (nonatomic) UIView *cellBackgroundView;
@property (nonatomic) OWSMessageHeaderView *headerView;
@property (nonatomic) NSLayoutConstraint *headerViewHeightConstraint;
@property (nonatomic) NSArray<NSLayoutConstraint *> *layoutConstraints;
@ -114,6 +115,7 @@ typedef void (^SystemMessageActionBlock)(void);
self.vStackView.spacing = self.buttonVSpacing;
self.vStackView.alignment = UIStackViewAlignmentCenter;
self.vStackView.layoutMarginsRelativeArrangement = YES;
self.cellBackgroundView = [self.vStackView addBackgroundViewWithBackgroundColor:Theme.backgroundColor];
UIStackView *cellStackView = [[UIStackView alloc] initWithArrangedSubviews:@[ self.headerView, self.vStackView ]];
cellStackView.axis = UILayoutConstraintAxisVertical;
@ -162,6 +164,8 @@ typedef void (^SystemMessageActionBlock)(void);
OWSAssert(self.viewItem);
OWSAssert(transaction);
self.cellBackgroundView.backgroundColor = [Theme backgroundColor];
[self.button setBackgroundColor:Theme.conversationButtonBackgroundColor];
TSInteraction *interaction = self.viewItem.interaction;

@ -234,7 +234,6 @@ typedef enum : NSUInteger {
@property (nonatomic) ContactShareViewHelper *contactShareViewHelper;
@property (nonatomic) NSTimer *reloadTimer;
@property (nonatomic, nullable) NSDate *lastReloadDate;
@property (nonatomic) BOOL didChangeTheme;
@end
@ -353,10 +352,6 @@ typedef enum : NSUInteger {
selector:@selector(keyboardWillChangeFrame:)
name:UIKeyboardWillChangeFrameNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(themeDidChange:)
name:ThemeDidChangeNotification
object:nil];
}
- (BOOL)isGroupConversation
@ -1185,13 +1180,6 @@ typedef enum : NSUInteger {
[self becomeFirstResponder];
}
}
if (self.didChangeTheme) {
self.didChangeTheme = NO;
[self applyTheme];
[self.collectionView reloadData];
}
}
// `viewWillDisappear` is called whenever the view *starts* to disappear,
@ -4247,15 +4235,6 @@ typedef enum : NSUInteger {
}
}
- (void)themeDidChange:(NSNotification *)notification
{
OWSAssertIsOnMainThread();
[self applyTheme];
[self.collectionView reloadData];
self.didChangeTheme = YES;
}
- (void)applyTheme
{
OWSAssertIsOnMainThread();

@ -214,7 +214,6 @@ class ConversationSearchViewController: UITableViewController {
owsFail("searchResult was unexpectedly nil")
return UITableViewCell()
}
OWSTableItem.configureCell(cell)
cell.configure(withThread: searchResult.thread, contactsManager: contactsManager, blockedPhoneNumber: self.blockedPhoneNumberSet)
return cell
case .contacts:
@ -227,7 +226,6 @@ class ConversationSearchViewController: UITableViewController {
owsFail("searchResult was unexpectedly nil")
return UITableViewCell()
}
OWSTableItem.configureCell(cell)
cell.configure(with: searchResult.signalAccount, contactsManager: contactsManager)
return cell
case .messages:
@ -241,8 +239,6 @@ class ConversationSearchViewController: UITableViewController {
return UITableViewCell()
}
OWSTableItem.configureCell(cell)
var overrideSnippet = NSAttributedString()
var overrideDate: Date?
if searchResult.messageId != nil {

@ -194,6 +194,8 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssert(contactsManager);
OWSAssert(blockedPhoneNumberSet);
[OWSTableItem configureCell:self];
self.thread = thread;
self.contactsManager = contactsManager;

@ -806,7 +806,6 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
{
HomeViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:HomeViewCell.cellReuseIdentifier];
OWSAssert(cell);
[OWSTableItem configureCell:cell];
ThreadViewModel *thread = [self threadViewModelForIndexPath:indexPath];
[cell configureWithThread:thread

@ -71,6 +71,9 @@ class ContactCell: UITableViewCell {
}
func configure(contact: Contact, subtitleType: SubtitleCellValue, showsWhenSelected: Bool, contactsManager: OWSContactsManager) {
OWSTableItem.configureCell(self)
self.contact = contact
self.showsWhenSelected = showsWhenSelected

@ -108,6 +108,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
+ (void)configureCell:(UITableViewCell *)cell
{
cell.backgroundColor = [Theme backgroundColor];
cell.contentView.backgroundColor = [Theme backgroundColor];
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
cell.textLabel.textColor = [Theme primaryColor];

@ -46,7 +46,6 @@ NS_ASSUME_NONNULL_BEGIN
self.preservesSuperviewLayoutMargins = YES;
self.contentView.preservesSuperviewLayoutMargins = YES;
[OWSTableItem configureCell:self];
self.cellView = [ContactCellView new];
[self.contentView addSubview:self.cellView];
@ -56,11 +55,13 @@ NS_ASSUME_NONNULL_BEGIN
- (void)configureWithSignalAccount:(SignalAccount *)signalAccount contactsManager:(OWSContactsManager *)contactsManager
{
[self.cellView configureWithRecipientId:signalAccount.recipientId contactsManager:contactsManager];
[self configureWithRecipientId:signalAccount.recipientId contactsManager:contactsManager];
}
- (void)configureWithRecipientId:(NSString *)recipientId contactsManager:(OWSContactsManager *)contactsManager
{
[OWSTableItem configureCell:self];
[self.cellView configureWithRecipientId:recipientId contactsManager:contactsManager];
// Force layout, since imageView isn't being initally rendered on App Store optimized build.
@ -71,6 +72,8 @@ NS_ASSUME_NONNULL_BEGIN
{
OWSAssert(thread);
[OWSTableItem configureCell:self];
[self.cellView configureWithThread:thread contactsManager:contactsManager];
// Force layout, since imageView isn't being initally rendered on App Store optimized build.

@ -143,7 +143,7 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value);
@interface UIStackView (OWS)
- (void)addBackgroundViewWithBackgroundColor:(UIColor *)backgroundColor;
- (UIView *)addBackgroundViewWithBackgroundColor:(UIColor *)backgroundColor;
@end

@ -538,12 +538,14 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
@implementation UIStackView (OWS)
- (void)addBackgroundViewWithBackgroundColor:(UIColor *)backgroundColor
- (UIView *)addBackgroundViewWithBackgroundColor:(UIColor *)backgroundColor
{
UIView *subview = [UIView new];
subview.backgroundColor = backgroundColor;
[self addSubview:subview];
[subview autoPinEdgesToSuperviewEdges];
[self sendSubviewToBack:subview];
return subview;
}
@end

Loading…
Cancel
Save