From fb0c47aa12afca0759e8a3deaa86480c42b5f910 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 25 Apr 2018 11:38:25 -0400 Subject: [PATCH] Fix dynamic type issues. --- .../ConversationView/Cells/OWSSystemMessageCell.m | 3 +++ .../ConversationView/Cells/OWSUnreadIndicatorCell.m | 8 ++++++++ Signal/src/ViewControllers/HomeView/HomeViewCell.m | 12 ++++++++++++ 3 files changed, 23 insertions(+) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSSystemMessageCell.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSSystemMessageCell.m index 4381b6633..c2e84cfa6 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSSystemMessageCell.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSSystemMessageCell.m @@ -169,6 +169,9 @@ NS_ASSUME_NONNULL_BEGIN OWSAssert(interaction); OWSAssert(label); + // Update cell to reflect changes in dynamic text. + self.titleLabel.font = [self titleFont]; + // TODO: Should we move the copy generation into this view? if ([interaction isKindOfClass:[TSErrorMessage class]]) { diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSUnreadIndicatorCell.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSUnreadIndicatorCell.m index 13ceeb817..ffa23218c 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSUnreadIndicatorCell.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSUnreadIndicatorCell.m @@ -94,6 +94,10 @@ NS_ASSUME_NONNULL_BEGIN self.titleLabel.text = [self titleForInteraction:interaction]; self.subtitleLabel.text = [self subtitleForInteraction:interaction]; + // Update cell to reflect changes in dynamic text. + self.titleLabel.font = [self titleFont]; + self.subtitleLabel.font = [self subtitleFont]; + self.backgroundColor = [UIColor whiteColor]; [self setNeedsLayout]; @@ -209,6 +213,10 @@ NS_ASSUME_NONNULL_BEGIN TSUnreadIndicatorInteraction *interaction = (TSUnreadIndicatorInteraction *)self.viewItem.interaction; + // Update cell to reflect changes in dynamic text. + self.titleLabel.font = [self titleFont]; + self.subtitleLabel.font = [self subtitleFont]; + // TODO: Should we use viewWidth? CGSize result = CGSizeMake(viewWidth, 0); result.height += self.titleVMargin * 2.f; diff --git a/Signal/src/ViewControllers/HomeView/HomeViewCell.m b/Signal/src/ViewControllers/HomeView/HomeViewCell.m index 785c4cfc5..6e04ed7be 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewCell.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewCell.m @@ -94,6 +94,10 @@ NS_ASSUME_NONNULL_BEGIN [self.nameLabel setContentHuggingHorizontalLow]; [self.nameLabel setCompressionResistanceHorizontalLow]; + [self.contentView addBorderWithColor:[UIColor blueColor]]; + [self.nameLabel addRedBorder]; + [self.snippetLabel addRedBorder]; + self.dateTimeLabel = [UILabel new]; [self.dateTimeLabel setContentHuggingHorizontalHigh]; [self.dateTimeLabel setCompressionResistanceHorizontalHigh]; @@ -125,6 +129,14 @@ NS_ASSUME_NONNULL_BEGIN [self.unreadLabel autoCenterInSuperview]; [self.unreadLabel setContentHuggingHigh]; [self.unreadLabel setCompressionResistanceHigh]; + + UIView *payloadBorderView = [UIView new]; + [payloadBorderView addBorderWithColor:[UIColor greenColor]]; + [self.contentView addSubview:payloadBorderView]; + [payloadBorderView autoPinEdge:ALEdgeTop toEdge:ALEdgeTop ofView:self.payloadView]; + [payloadBorderView autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.payloadView]; + [payloadBorderView autoPinEdge:ALEdgeLeft toEdge:ALEdgeLeft ofView:self.payloadView]; + [payloadBorderView autoPinEdge:ALEdgeRight toEdge:ALEdgeRight ofView:self.payloadView]; } + (NSString *)cellReuseIdentifier