From c7f9575df63ccae844c754752aa5b7d3ddcbf5df Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 26 Jun 2018 11:02:52 -0400 Subject: [PATCH 1/2] Ensure bubble sizing. --- .../ConversationView/Cells/OWSMessageBubbleView.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m index a72b3bce6..fb95e1ff0 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m @@ -415,9 +415,12 @@ NS_ASSUME_NONNULL_BEGIN if (textStackView) { CGSize bubbleSize = [self measureSize]; - [self.viewConstraints addObjectsFromArray:@[ - [self autoSetDimension:ALDimensionWidth toSize:bubbleSize.width relation:NSLayoutRelationLessThanOrEqual], - ]]; + [NSLayoutConstraint autoSetPriority:UILayoutPriorityDefaultHigh + forConstraints:^{ + [self.viewConstraints addObjectsFromArray:@[ + [self autoSetDimension:ALDimensionWidth toSize:bubbleSize.width], + ]]; + }]; } } From 2232c254876ab1c3d741f745a6726445d66c5f51 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 26 Jun 2018 11:23:45 -0400 Subject: [PATCH 2/2] Ensure bubble sizing. --- .../ConversationView/Cells/OWSMessageBubbleView.m | 2 +- .../ViewControllers/ConversationView/ConversationStyle.swift | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m index fb95e1ff0..83d4a6701 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m @@ -415,7 +415,7 @@ NS_ASSUME_NONNULL_BEGIN if (textStackView) { CGSize bubbleSize = [self measureSize]; - [NSLayoutConstraint autoSetPriority:UILayoutPriorityDefaultHigh + [NSLayoutConstraint autoSetPriority:UILayoutPriorityRequired forConstraints:^{ [self.viewConstraints addObjectsFromArray:@[ [self autoSetDimension:ALDimensionWidth toSize:bubbleSize.width], diff --git a/Signal/src/ViewControllers/ConversationView/ConversationStyle.swift b/Signal/src/ViewControllers/ConversationView/ConversationStyle.swift index 26aedecf3..f752dfb0e 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationStyle.swift +++ b/Signal/src/ViewControllers/ConversationView/ConversationStyle.swift @@ -38,9 +38,6 @@ public class ConversationStyle: NSObject { @objc public var fullWidthContentWidth: CGFloat = 0 @objc public var maxMessageWidth: CGFloat = 0 - // TODO: Can we eliminate this after moving timestamps and - // message status inside the message bubbles. - @objc public var maxFooterWidth: CGFloat = 0 @objc public var textInsetTop: CGFloat = 0 @objc public var textInsetBottom: CGFloat = 0 @@ -98,8 +95,6 @@ public class ConversationStyle: NSObject { fullWidthContentWidth = viewWidth - (fullWidthGutterLeading + fullWidthGutterTrailing) maxMessageWidth = floor(contentWidth - 48) - // TODO: Should this be different? - maxFooterWidth = maxMessageWidth - 10 let messageTextFont = UIFont.ows_dynamicTypeBody // Don't include the distance from the "cap height" to the top of the UILabel