Apply design changes from Myles.

pull/1/head
Matthew Chen 7 years ago
parent aedeca03dd
commit 6a69070ce9

@ -7,7 +7,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
const CGFloat kOWSMessageCellCornerRadius = 17; const CGFloat kOWSMessageCellCornerRadius = 18;
const CGFloat kBubbleVRounding = kOWSMessageCellCornerRadius; const CGFloat kBubbleVRounding = kOWSMessageCellCornerRadius;
const CGFloat kBubbleHRounding = kOWSMessageCellCornerRadius; const CGFloat kBubbleHRounding = kOWSMessageCellCornerRadius;

@ -69,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN
[self.contentView addSubview:self.dateHeaderLabel]; [self.contentView addSubview:self.dateHeaderLabel];
self.footerLabel = [UILabel new]; self.footerLabel = [UILabel new];
self.footerLabel.font = UIFont.ows_dynamicTypeCaption1Font; self.footerLabel.font = UIFont.ows_dynamicTypeCaption2Font;
self.footerLabel.textColor = [UIColor lightGrayColor]; self.footerLabel.textColor = [UIColor lightGrayColor];
[self.footerView addSubview:self.footerLabel]; [self.footerView addSubview:self.footerLabel];
@ -80,7 +80,6 @@ NS_ASSUME_NONNULL_BEGIN
[self.messageBubbleView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.dateHeaderLabel]; [self.messageBubbleView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.dateHeaderLabel];
[self.footerView autoPinEdgeToSuperviewEdge:ALEdgeBottom]; [self.footerView autoPinEdgeToSuperviewEdge:ALEdgeBottom];
[self.footerView autoPinWidthToSuperview];
self.contentView.userInteractionEnabled = YES; self.contentView.userInteractionEnabled = YES;
@ -161,6 +160,10 @@ NS_ASSUME_NONNULL_BEGIN
[self.messageBubbleView configureViews]; [self.messageBubbleView configureViews];
[self.messageBubbleView loadContent]; [self.messageBubbleView loadContent];
// Update label fonts to honor dynamic type size.
self.dateHeaderLabel.font = self.dateHeaderDateFont;
self.footerLabel.font = UIFont.ows_dynamicTypeCaption2Font;
if (self.shouldHaveFailedSendBadge) { if (self.shouldHaveFailedSendBadge) {
self.failedSendBadgeView = [UIImageView new]; self.failedSendBadgeView = [UIImageView new];
self.failedSendBadgeView.image = self.failedSendBadgeView.image =
@ -294,7 +297,7 @@ NS_ASSUME_NONNULL_BEGIN
- (CGFloat)footerVSpacing - (CGFloat)footerVSpacing
{ {
return 1.f; return 0.f;
} }
- (void)updateFooter - (void)updateFooter
@ -327,6 +330,13 @@ NS_ASSUME_NONNULL_BEGIN
return; return;
} }
[self.viewConstraints addObjectsFromArray:@[
(self.isIncoming ? [self.footerView autoPinLeadingToSuperviewMarginWithInset:kBubbleThornSideInset]
: [self.footerView autoPinTrailingToSuperviewMarginWithInset:kBubbleThornSideInset]),
(self.isIncoming ? [self.footerView autoPinTrailingToSuperviewMargin]
: [self.footerView autoPinLeadingToSuperviewMargin]),
]];
[self.viewConstraints addObject:[self.footerView autoPinEdge:ALEdgeTop [self.viewConstraints addObject:[self.footerView autoPinEdge:ALEdgeTop
toEdge:ALEdgeBottom toEdge:ALEdgeBottom
ofView:self.messageBubbleView ofView:self.messageBubbleView

@ -467,7 +467,7 @@ NS_ASSUME_NONNULL_BEGIN
- (CGFloat)quotedTextBottomInset - (CGFloat)quotedTextBottomInset
{ {
return 4.f; return 8.f;
} }
- (CGFloat)quotedReplyStripeThickness - (CGFloat)quotedReplyStripeThickness

@ -291,9 +291,9 @@ NS_ASSUME_NONNULL_BEGIN
dateTimeString = [[DateUtil timeFormatter] stringFromDate:date]; dateTimeString = [[DateUtil timeFormatter] stringFromDate:date];
} }
return [[NSAttributedString alloc] initWithString:dateTimeString return [[NSAttributedString alloc] initWithString:dateTimeString.uppercaseString
attributes:@{ attributes:@{
NSForegroundColorAttributeName : [UIColor ows_darkGrayColor], NSForegroundColorAttributeName : [UIColor blackColor],
NSFontAttributeName : self.dateTimeFont, NSFontAttributeName : self.dateTimeFont,
}]; }];
} }
@ -302,7 +302,7 @@ NS_ASSUME_NONNULL_BEGIN
- (UIFont *)dateTimeFont - (UIFont *)dateTimeFont
{ {
return [UIFont ows_dynamicTypeFootnoteFont]; return [UIFont ows_dynamicTypeFootnoteFont].ows_medium;
} }
- (UIFont *)snippetFont - (UIFont *)snippetFont
@ -339,7 +339,17 @@ NS_ASSUME_NONNULL_BEGIN
+ (CGFloat)rowHeight + (CGFloat)rowHeight
{ {
return 72; // Scale the cell height using size of dynamic "body" type as a reference.
const CGFloat kReferenceFontSizeMin = 17.f;
const CGFloat kReferenceFontSizeMax = 23.f;
CGFloat referenceFontSize = UIFont.ows_dynamicTypeBodyFont.pointSize;
CGFloat alpha = CGFloatClamp01(CGFloatInverseLerp(referenceFontSize, kReferenceFontSizeMin, kReferenceFontSizeMax));
const CGFloat kCellHeightMin = 68.f;
const CGFloat kCellHeightMax = 76.f;
CGFloat result = ceil(CGFloatLerp(kCellHeightMin, kCellHeightMax, alpha));
return result;
} }
- (NSUInteger)cellHMargin - (NSUInteger)cellHMargin

Loading…
Cancel
Save