Refine appearance of quoted reply message cells.

pull/1/head
Matthew Chen 7 years ago
parent dd36c945e4
commit 3343b4ec58

@ -406,9 +406,6 @@ CG_INLINE CGSize CGSizeCeil(CGSize size)
lastSubview = quotedMessageView; lastSubview = quotedMessageView;
bottomMargin = 0; bottomMargin = 0;
[self.bubbleView logFrameLaterWithLabel:@"bubbleView"];
[quotedMessageView logFrameLaterWithLabel:@"quotedMessageView"];
// TODO: Consider stroking the quoted thumbnail. // TODO: Consider stroking the quoted thumbnail.
} }
@ -882,6 +879,8 @@ CG_INLINE CGSize CGSizeCeil(CGSize size)
[quoteStripView autoPinHeightToSuperview]; [quoteStripView autoPinHeightToSuperview];
[quoteStripView autoPinLeadingToSuperviewMargin]; [quoteStripView autoPinLeadingToSuperviewMargin];
[quoteStripView autoSetDimension:ALDimensionWidth toSize:self.quotedReplyStripeThickness]; [quoteStripView autoSetDimension:ALDimensionWidth toSize:self.quotedReplyStripeThickness];
[quoteStripView setContentHuggingHigh];
[quoteStripView setCompressionResistanceHigh];
UIView *_Nullable quotedThumbnailView = nil; UIView *_Nullable quotedThumbnailView = nil;
if (self.hasQuotedAttachmentThumbnail) { if (self.hasQuotedAttachmentThumbnail) {
@ -894,6 +893,8 @@ CG_INLINE CGSize CGSizeCeil(CGSize size)
[quotedThumbnailView autoPinTrailingToSuperviewMargin]; [quotedThumbnailView autoPinTrailingToSuperviewMargin];
[quotedThumbnailView autoSetDimension:ALDimensionWidth toSize:self.quotedThumbnailSize]; [quotedThumbnailView autoSetDimension:ALDimensionWidth toSize:self.quotedThumbnailSize];
[quotedThumbnailView autoSetDimension:ALDimensionHeight toSize:self.quotedThumbnailSize]; [quotedThumbnailView autoSetDimension:ALDimensionHeight toSize:self.quotedThumbnailSize];
[quotedThumbnailView setContentHuggingHigh];
[quotedThumbnailView setCompressionResistanceHigh];
} }
OWSContactsManager *contactsManager = Environment.current.contactsManager; OWSContactsManager *contactsManager = Environment.current.contactsManager;
@ -910,10 +911,13 @@ CG_INLINE CGSize CGSizeCeil(CGSize size)
[quotedAuthorLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:self.quotedContentTopInset]; [quotedAuthorLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:self.quotedContentTopInset];
[quotedAuthorLabel autoPinLeadingToTrailingEdgeOfView:quoteStripView offset:self.quotedReplyStripeHSpacing]; [quotedAuthorLabel autoPinLeadingToTrailingEdgeOfView:quoteStripView offset:self.quotedReplyStripeHSpacing];
if (quotedThumbnailView) { if (quotedThumbnailView) {
[quotedAuthorLabel autoPinTrailingToEdgeOfView:quotedThumbnailView offset:self.quotedThumbnailHSpacing]; [quotedAuthorLabel autoPinTrailingToLeadingEdgeOfView:quotedThumbnailView offset:self.quotedThumbnailHSpacing];
} else { } else {
[quotedAuthorLabel autoPinTrailingToSuperviewMarginWithInset:self.quotedContentTrailingMargin]; [quotedAuthorLabel autoPinTrailingToSuperviewMarginWithInset:self.quotedContentTrailingMargin];
} }
[quotedAuthorLabel autoSetDimension:ALDimensionHeight toSize:self.quotedAuthorHeight];
[quotedAuthorLabel setContentHuggingLow];
[quotedAuthorLabel setCompressionResistanceLow];
if (self.hasQuotedText) { if (self.hasQuotedText) {
UILabel *quotedTextLabel = [self createQuotedTextLabel]; UILabel *quotedTextLabel = [self createQuotedTextLabel];
@ -925,12 +929,14 @@ CG_INLINE CGSize CGSizeCeil(CGSize size)
withOffset:self.quotedAuthorBottomSpacing]; withOffset:self.quotedAuthorBottomSpacing];
[quotedTextLabel autoPinLeadingToTrailingEdgeOfView:quoteStripView offset:self.quotedReplyStripeHSpacing]; [quotedTextLabel autoPinLeadingToTrailingEdgeOfView:quoteStripView offset:self.quotedReplyStripeHSpacing];
if (quotedThumbnailView) { if (quotedThumbnailView) {
[quotedTextLabel autoPinLeadingToTrailingEdgeOfView:quotedThumbnailView [quotedTextLabel autoPinTrailingToLeadingEdgeOfView:quotedThumbnailView
offset:self.quotedThumbnailHSpacing]; offset:self.quotedThumbnailHSpacing];
} else { } else {
[quotedTextLabel autoPinTrailingToSuperviewMarginWithInset:self.quotedContentTrailingMargin]; [quotedTextLabel autoPinTrailingToSuperviewMarginWithInset:self.quotedContentTrailingMargin];
} }
[quotedTextLabel autoPinBottomToSuperviewMarginWithInset:self.quotedContentBottomInset]; [quotedTextLabel autoPinBottomToSuperviewMarginWithInset:self.quotedContentBottomInset];
[quotedTextLabel setContentHuggingLow];
[quotedTextLabel setCompressionResistanceLow];
} }
return quotedMessageView; return quotedMessageView;

Loading…
Cancel
Save