Merge branch 'charlesmchen/breakSpacing'

pull/1/head
Matthew Chen 7 years ago
commit a0810b1972

@ -64,10 +64,10 @@ NS_ASSUME_NONNULL_BEGIN
[self.dateHeaderView addSubview:self.dateHeaderLabel];
[self.dateStrokeView autoPinWidthToSuperview];
[self.dateStrokeView autoPinEdgeToSuperviewEdge:ALEdgeTop];
[self.dateStrokeView autoSetDimension:ALDimensionHeight toSize:1.f];
[self.dateHeaderLabel autoPinWidthToSuperview];
[self.dateHeaderLabel autoVCenterInSuperview];
[self.dateStrokeView autoPinEdge:ALEdgeBottom toEdge:ALEdgeTop ofView:self.dateHeaderLabel];
[self.dateHeaderLabel autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.dateStrokeView];
self.avatarView = [[AvatarImageView alloc] init];
[self.avatarView autoSetDimension:ALDimensionWidth toSize:self.avatarSize];
@ -368,7 +368,7 @@ NS_ASSUME_NONNULL_BEGIN
return cellSize;
}
- (CGFloat)dateHeaderVSpacing
- (CGFloat)dateHeaderBottomMargin
{
return 24.f;
}
@ -377,7 +377,7 @@ NS_ASSUME_NONNULL_BEGIN
{
if (self.viewItem.shouldShowDate) {
CGFloat textHeight = MAX(self.dateHeaderDateFont.capHeight, self.dateHeaderTimeFont.capHeight);
return (CGFloat)ceil(textHeight + self.dateHeaderVSpacing * 2);
return (CGFloat)ceil(textHeight + self.dateHeaderBottomMargin);
} else {
return 0.f;
}

@ -98,14 +98,15 @@ NS_ASSUME_NONNULL_BEGIN
[NSLayoutConstraint deactivateConstraints:self.layoutConstraints];
self.layoutConstraints = @[
[self.titleLabel autoVCenterInSuperview],
[self.titleLabel autoPinLeadingToSuperviewMarginWithInset:self.conversationStyle.fullWidthGutterLeading],
[self.titleLabel autoPinTrailingToSuperviewMarginWithInset:self.conversationStyle.fullWidthGutterTrailing],
[self.strokeView autoPinEdge:ALEdgeBottom toEdge:ALEdgeTop ofView:self.titleLabel],
[self.strokeView autoPinEdgeToSuperviewEdge:ALEdgeTop],
[self.strokeView autoPinLeadingToSuperviewMarginWithInset:self.conversationStyle.fullWidthGutterLeading],
[self.strokeView autoPinTrailingToSuperviewMarginWithInset:self.conversationStyle.fullWidthGutterTrailing],
[self.strokeView autoSetDimension:ALDimensionHeight toSize:1.f],
[self.strokeView autoSetDimension:ALDimensionHeight toSize:self.strokeHeight],
[self.titleLabel autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.strokeView],
[self.titleLabel autoPinEdgeToSuperviewEdge:ALEdgeTop],
[self.titleLabel autoPinLeadingToSuperviewMarginWithInset:self.conversationStyle.fullWidthGutterLeading],
[self.titleLabel autoPinTrailingToSuperviewMarginWithInset:self.conversationStyle.fullWidthGutterTrailing],
[self.subtitleLabel autoPinEdge:ALEdgeTop
toEdge:ALEdgeBottom
@ -134,6 +135,11 @@ NS_ASSUME_NONNULL_BEGIN
@"Messages that indicates that there are more unseen messages including safety number changes."));
}
- (CGFloat)strokeHeight
{
return 1.f;
}
- (CGFloat)subtitleVSpacing
{
return 3.f;
@ -147,10 +153,8 @@ NS_ASSUME_NONNULL_BEGIN
[self configureFonts];
// TODO: offset.
CGFloat vOffset = 24.f;
CGSize result
= CGSizeMake(self.conversationStyle.fullWidthContentWidth, self.titleLabel.font.lineHeight + vOffset * 2);
= CGSizeMake(self.conversationStyle.fullWidthContentWidth, self.strokeHeight + self.titleLabel.font.lineHeight);
TSUnreadIndicatorInteraction *interaction = (TSUnreadIndicatorInteraction *)self.viewItem.interaction;
self.subtitleLabel.text = [self subtitleForInteraction:interaction];

@ -275,9 +275,9 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
OWSAssert(previousLayoutItem);
if (self.interaction.interactionType == OWSInteractionType_UnreadIndicator
|| previousLayoutItem.interaction.interactionType == OWSInteractionType_UnreadIndicator) {
// The unread indicator has its own v-margins.
return 0.f;
|| previousLayoutItem.interaction.interactionType == OWSInteractionType_UnreadIndicator
|| self.shouldShowDate) {
return 20.f;
}
// "Bubble Collapse". Adjacent messages with the same author should be close together.

Loading…
Cancel
Save