diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m index c8483ed5d..5b51b8689 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m @@ -609,12 +609,12 @@ NS_ASSUME_NONNULL_BEGIN - (CGFloat)bodyMediaQuotedReplyVSpacing { - return 8.f; + return 6.f; } - (CGFloat)quotedReplyTopMargin { - return 7.f; + return 6.f; } #pragma mark - Load / Unload @@ -1026,7 +1026,6 @@ NS_ASSUME_NONNULL_BEGIN } CGFloat hMargins = self.conversationStyle.textInsetHorizontal * 2; - const int maxTextWidth = (int)floor(self.conversationStyle.maxMessageWidth - hMargins); [self configureBodyTextView]; @@ -1042,6 +1041,10 @@ NS_ASSUME_NONNULL_BEGIN OWSAssert(self.conversationStyle.maxMessageWidth > 0); CGFloat maxMessageWidth = self.conversationStyle.maxMessageWidth; + if (!self.hasFullWidthMediaView) { + CGFloat hMargins = self.conversationStyle.textInsetHorizontal * 2; + maxMessageWidth -= hMargins; + } CGSize result = CGSizeZero; switch (self.cellType) { @@ -1150,7 +1153,7 @@ NS_ASSUME_NONNULL_BEGIN const int maxTextWidth = (int)floor(self.conversationStyle.maxMessageWidth - hMargins); [self configureSenderNameLabel]; CGSize result = CGSizeCeil([self.senderNameLabel sizeThatFits:CGSizeMake(maxTextWidth, CGFLOAT_MAX)]); - + result.width = MIN(result.width, maxTextWidth); return [NSValue valueWithCGSize:result]; } @@ -1230,6 +1233,9 @@ NS_ASSUME_NONNULL_BEGIN cellSize = CGSizeCeil(cellSize); + OWSAssert(cellSize.width <= self.conversationStyle.maxMessageWidth); + cellSize.width = MIN(cellSize.width, self.conversationStyle.maxMessageWidth); + return cellSize; } diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m index f0adfd989..304a26534 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m @@ -131,6 +131,11 @@ NS_ASSUME_NONNULL_BEGIN return 8.f; } +- (CGFloat)vSpacing +{ + return 2.f; +} + - (CGFloat)stripeThickness { return 4.f; @@ -204,6 +209,7 @@ NS_ASSUME_NONNULL_BEGIN vStackView.axis = UILayoutConstraintAxisVertical; vStackView.layoutMargins = UIEdgeInsetsMake(self.textVMargin, 0, self.textVMargin, 0); vStackView.layoutMarginsRelativeArrangement = YES; + vStackView.spacing = self.vSpacing; [hStackView addArrangedSubview:vStackView]; UILabel *quotedAuthorLabel = [self configureQuotedAuthorLabel]; @@ -469,7 +475,7 @@ NS_ASSUME_NONNULL_BEGIN // Quoted Author CGFloat textWidth = 0.f; CGFloat maxTextWidth = maxWidth - result.width; - CGFloat textHeight = self.textVMargin * 2 + self.quotedAuthorHeight; + CGFloat textHeight = self.textVMargin * 2 + self.quotedAuthorHeight + self.vSpacing; { UILabel *quotedAuthorLabel = [self configureQuotedAuthorLabel]; diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m b/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m index af8e585d0..4daddfa25 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m @@ -293,8 +293,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType) return 2.f; } - // TODO: - return 10.f; + return 12.f; } - (ConversationViewCell *)dequeueCellForCollectionView:(UICollectionView *)collectionView