Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent 94e9c72e67
commit f6d5b9197c

@ -100,7 +100,7 @@ NS_ASSUME_NONNULL_BEGIN
- (UIFont *)titleFont
{
return UIFont.ows_dynamicTypeBodyFont.ows_medium;
return UIFont.ows_dynamicTypeBodyFont.ows_mediumWeight;
}
- (UIFont *)buttonFont

@ -386,7 +386,7 @@ NS_ASSUME_NONNULL_BEGIN
- (UIFont *)dateHeaderDateFont
{
return UIFont.ows_dynamicTypeCaption1Font.ows_medium;
return UIFont.ows_dynamicTypeCaption1Font.ows_mediumWeight;
}
- (UIFont *)dateHeaderTimeFont

@ -412,7 +412,7 @@ NS_ASSUME_NONNULL_BEGIN
- (UIFont *)quotedAuthorFont
{
return UIFont.ows_dynamicTypeCaption1Font.ows_medium;
return UIFont.ows_dynamicTypeCaption1Font.ows_mediumWeight;
}
- (UIColor *)quotedAuthorColor

@ -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];
}

@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN
- (UIFont *)ows_italic;
- (UIFont *)ows_bold;
- (UIFont *)ows_medium;
- (UIFont *)ows_mediumWeight;
@end

@ -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:

Loading…
Cancel
Save