From f6d5b9197c3c21b19638db7b8f6755b008f1bd19 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 16 Apr 2018 12:39:11 -0400 Subject: [PATCH] Respond to CR. --- .../Cells/OWSContactOffersCell.m | 2 +- .../ConversationView/Cells/OWSMessageCell.m | 2 +- .../Cells/OWSQuotedMessageView.m | 2 +- .../ViewControllers/HomeView/HomeViewCell.m | 26 +++++++++---------- SignalMessaging/categories/UIFont+OWS.h | 2 +- SignalMessaging/categories/UIFont+OWS.m | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSContactOffersCell.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSContactOffersCell.m index 253c39bf1..a86655a7b 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSContactOffersCell.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSContactOffersCell.m @@ -100,7 +100,7 @@ NS_ASSUME_NONNULL_BEGIN - (UIFont *)titleFont { - return UIFont.ows_dynamicTypeBodyFont.ows_medium; + return UIFont.ows_dynamicTypeBodyFont.ows_mediumWeight; } - (UIFont *)buttonFont diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m index ecd5ab68b..3825b413a 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m @@ -386,7 +386,7 @@ NS_ASSUME_NONNULL_BEGIN - (UIFont *)dateHeaderDateFont { - return UIFont.ows_dynamicTypeCaption1Font.ows_medium; + return UIFont.ows_dynamicTypeCaption1Font.ows_mediumWeight; } - (UIFont *)dateHeaderTimeFont diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m index 1ba2cdcac..a2e84cacb 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m @@ -412,7 +412,7 @@ NS_ASSUME_NONNULL_BEGIN - (UIFont *)quotedAuthorFont { - return UIFont.ows_dynamicTypeCaption1Font.ows_medium; + return UIFont.ows_dynamicTypeCaption1Font.ows_mediumWeight; } - (UIColor *)quotedAuthorColor diff --git a/Signal/src/ViewControllers/HomeView/HomeViewCell.m b/Signal/src/ViewControllers/HomeView/HomeViewCell.m index 9c2329bbd..4109d65eb 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewCell.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewCell.m @@ -26,8 +26,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic) UILabel *dateTimeLabel; // The unread badge has a larger v-height than the other elements in its // row. We don't want it to distort the v-alignment of the cell's labels -// so we use a placeholder to reserve the correct width. -@property (nonatomic) UIView *unreadPlaceholder; +// so we use a container to reserve the correct width. +@property (nonatomic) UIView *unreadBadgeContainer; @property (nonatomic) UIView *unreadBadge; @property (nonatomic) UILabel *unreadLabel; @@ -125,13 +125,13 @@ NS_ASSUME_NONNULL_BEGIN self.unreadLabel.lineBreakMode = NSLineBreakByTruncatingTail; self.unreadLabel.textAlignment = NSTextAlignmentCenter; - self.unreadPlaceholder = [UIView containerView]; - [self.unreadPlaceholder setContentHuggingHigh]; - [self.unreadPlaceholder setCompressionResistanceHigh]; + self.unreadBadgeContainer = [UIView containerView]; + [self.unreadBadgeContainer setContentHuggingHigh]; + [self.unreadBadgeContainer setCompressionResistanceHigh]; self.unreadBadge = [NeverClearView new]; self.unreadBadge.backgroundColor = [UIColor ows_materialBlueColor]; - [self.unreadPlaceholder addSubview:self.unreadBadge]; + [self.unreadBadgeContainer addSubview:self.unreadBadge]; [self.unreadBadge autoCenterInSuperview]; [self.unreadBadge setContentHuggingHigh]; [self.unreadBadge setCompressionResistanceHigh]; @@ -191,7 +191,7 @@ NS_ASSUME_NONNULL_BEGIN NSUInteger unreadCount = [[OWSMessageUtils sharedManager] unreadMessagesInThread:thread]; if (unreadCount > 0) { - [self.topRowView addArrangedSubview:self.unreadPlaceholder]; + [self.topRowView addArrangedSubview:self.unreadBadgeContainer]; self.unreadLabel.font = [UIFont ows_dynamicTypeCaption1Font]; self.unreadLabel.text = [OWSFormat formatInt:MIN(99, (int)unreadCount)]; @@ -203,7 +203,7 @@ NS_ASSUME_NONNULL_BEGIN self.unreadBadge.layer.cornerRadius = unreadBadgeSize / 2; [self.viewConstraints addObjectsFromArray:@[ - [self.unreadPlaceholder autoSetDimension:ALDimensionWidth toSize:unreadBadgeSize], + [self.unreadBadgeContainer autoSetDimension:ALDimensionWidth toSize:unreadBadgeSize], [self.unreadBadge autoSetDimension:ALDimensionWidth toSize:unreadBadgeSize], [self.unreadBadge autoSetDimension:ALDimensionHeight toSize:unreadBadgeSize], ]]; @@ -250,7 +250,7 @@ NS_ASSUME_NONNULL_BEGIN initWithString:NSLocalizedString(@"HOME_VIEW_BLOCKED_CONTACT_CONVERSATION", @"A label for conversations with blocked users.") attributes:@{ - NSFontAttributeName : self.snippetFont.ows_medium, + NSFontAttributeName : self.snippetFont.ows_mediumWeight, NSForegroundColorAttributeName : [UIColor ows_blackColor], }]]; } else { @@ -270,7 +270,7 @@ NS_ASSUME_NONNULL_BEGIN initWithString:displayableText attributes:@{ NSFontAttributeName : - (hasUnreadMessages ? self.snippetFont.ows_medium + (hasUnreadMessages ? self.snippetFont.ows_mediumWeight : self.snippetFont), NSForegroundColorAttributeName : (hasUnreadMessages ? [UIColor ows_blackColor] @@ -313,7 +313,7 @@ NS_ASSUME_NONNULL_BEGIN - (UIFont *)dateTimeFont { - return [UIFont ows_dynamicTypeFootnoteFont].ows_medium; + return [UIFont ows_dynamicTypeFootnoteFont].ows_mediumWeight; } - (UIFont *)snippetFont @@ -323,7 +323,7 @@ NS_ASSUME_NONNULL_BEGIN - (UIFont *)nameFont { - return [UIFont ows_dynamicTypeBodyFont].ows_medium; + return [UIFont ows_dynamicTypeBodyFont].ows_mediumWeight; } // Used for profile names. @@ -390,7 +390,7 @@ NS_ASSUME_NONNULL_BEGIN self.thread = nil; self.contactsManager = nil; - [self.unreadPlaceholder removeFromSuperview]; + [self.unreadBadgeContainer removeFromSuperview]; [[NSNotificationCenter defaultCenter] removeObserver:self]; } diff --git a/SignalMessaging/categories/UIFont+OWS.h b/SignalMessaging/categories/UIFont+OWS.h index af28e1cd9..9d73f4453 100644 --- a/SignalMessaging/categories/UIFont+OWS.h +++ b/SignalMessaging/categories/UIFont+OWS.h @@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN - (UIFont *)ows_italic; - (UIFont *)ows_bold; -- (UIFont *)ows_medium; +- (UIFont *)ows_mediumWeight; @end diff --git a/SignalMessaging/categories/UIFont+OWS.m b/SignalMessaging/categories/UIFont+OWS.m index 780f86d44..4a114031a 100644 --- a/SignalMessaging/categories/UIFont+OWS.m +++ b/SignalMessaging/categories/UIFont+OWS.m @@ -117,7 +117,7 @@ NS_ASSUME_NONNULL_BEGIN return font ?: self; } -- (UIFont *)ows_medium +- (UIFont *)ows_mediumWeight { // The recommended approach of deriving "medium" weight fonts for dynamic // type fonts is: