From 324afb11524126c4c9bc7356316b540e18aeaebb Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 3 Apr 2018 14:39:40 -0400 Subject: [PATCH] Modify cells to show quoted messages. --- .../ConversationView/Cells/OWSMessageCell.m | 24 +++++++++---------- .../ViewControllers/DebugUI/DebugUIMessages.m | 1 + 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m index a27a8a591..e6a11c1dc 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m @@ -396,8 +396,8 @@ CG_INLINE CGSize CGSizeCeil(CGSize size) CGFloat trailingMargin = self.quotedBubbleTrailingMargin; [self.viewConstraints addObjectsFromArray:@[ - [quotedMessageView autoPinLeadingToSuperviewWithMargin:leadingMargin], - [quotedMessageView autoPinTrailingToSuperviewWithMargin:trailingMargin], + [quotedMessageView autoPinLeadingToSuperviewMarginWithInset:leadingMargin], + [quotedMessageView autoPinTrailingToSuperviewMarginWithInset:trailingMargin], ]]; if (lastSubview) { @@ -882,7 +882,7 @@ CG_INLINE CGSize CGSizeCeil(CGSize size) quoteStripView.userInteractionEnabled = NO; [quotedMessageView addSubview:quoteStripView]; [quoteStripView autoPinHeightToSuperview]; - [quoteStripView autoPinLeadingToSuperview]; + [quoteStripView autoPinLeadingToSuperviewMargin]; [quoteStripView autoSetDimension:ALDimensionWidth toSize:self.quotedReplyStripeThickness]; UIView *_Nullable quotedThumbnailView = nil; @@ -892,8 +892,8 @@ CG_INLINE CGSize CGSizeCeil(CGSize size) quotedThumbnailView.userInteractionEnabled = NO; quotedThumbnailView.backgroundColor = [UIColor redColor]; [quotedMessageView addSubview:quotedThumbnailView]; - [quotedThumbnailView autoPinTopToSuperview]; - [quotedThumbnailView autoPinTrailingToSuperview]; + [quotedThumbnailView autoPinTopToSuperviewMargin]; + [quotedThumbnailView autoPinTrailingToSuperviewMargin]; [quotedThumbnailView autoSetDimension:ALDimensionWidth toSize:self.quotedThumbnailSize]; [quotedThumbnailView autoSetDimension:ALDimensionHeight toSize:self.quotedThumbnailSize]; } @@ -910,11 +910,11 @@ CG_INLINE CGSize CGSizeCeil(CGSize size) quotedAuthorLabel.lineBreakMode = NSLineBreakByTruncatingTail; [quotedMessageView addSubview:quotedAuthorLabel]; [quotedAuthorLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:self.quotedContentTopInset]; - [quotedAuthorLabel autoPinLeadingToView:quoteStripView margin:self.quotedReplyStripeHSpacing]; + [quotedAuthorLabel autoPinLeadingToTrailingEdgeOfView:quoteStripView offset:self.quotedReplyStripeHSpacing]; if (quotedThumbnailView) { - [quotedAuthorLabel autoPinTrailingToView:quotedThumbnailView margin:self.quotedThumbnailHSpacing]; + [quotedAuthorLabel autoPinTrailingToEdgeOfView:quotedThumbnailView offset:self.quotedThumbnailHSpacing]; } else { - [quotedAuthorLabel autoPinTrailingToSuperviewWithMargin:self.quotedContentTrailingMargin]; + [quotedAuthorLabel autoPinTrailingToSuperviewMarginWithInset:self.quotedContentTrailingMargin]; } if (self.hasQuotedText) { @@ -925,13 +925,13 @@ CG_INLINE CGSize CGSizeCeil(CGSize size) toEdge:ALEdgeBottom ofView:quotedAuthorLabel withOffset:self.quotedAuthorBottomSpacing]; - [quotedTextView autoPinLeadingToView:quoteStripView margin:self.quotedReplyStripeHSpacing]; + [quotedTextView autoPinLeadingToTrailingEdgeOfView:quoteStripView offset:self.quotedReplyStripeHSpacing]; if (quotedThumbnailView) { - [quotedTextView autoPinTrailingToView:quotedThumbnailView margin:self.quotedThumbnailHSpacing]; + [quotedTextView autoPinLeadingToTrailingEdgeOfView:quotedThumbnailView offset:self.quotedThumbnailHSpacing]; } else { - [quotedTextView autoPinTrailingToSuperviewWithMargin:self.quotedContentTrailingMargin]; + [quotedTextView autoPinTrailingToSuperviewMarginWithInset:self.quotedContentTrailingMargin]; } - [quotedTextView autoPinBottomToSuperviewWithMargin:self.quotedContentBottomInset]; + [quotedTextView autoPinBottomToSuperviewMarginWithInset:self.quotedContentBottomInset]; } return quotedMessageView; diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m index 1ecb57395..846d4b9dd 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m @@ -2496,6 +2496,7 @@ isQuotedMessageAttachmentDownloaded:(BOOL)isQuotedMessageAttachmentDownloaded [actions addObjectsFromArray:[self allFakeMediaActions:thread includeLabels:includeLabels]]; [actions addObjectsFromArray:[self allFakeTextActions:thread includeLabels:includeLabels]]; [actions addObjectsFromArray:[self allFakeSequenceActions:thread includeLabels:includeLabels]]; + [actions addObjectsFromArray:[self allFakeQuotedReplyActions:thread includeLabels:includeLabels]]; return actions; }