From 95cf4f5c6db4d5e0773dc3122a23e0bc49219222 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 3 Aug 2018 10:25:56 -0400 Subject: [PATCH] Don't reserve space for timestamp in footer. --- .../Cells/OWSMessageFooterView.m | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m index dba52699d..73effa78d 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m @@ -228,29 +228,6 @@ NS_ASSUME_NONNULL_BEGIN // Measure the actual current width, to be safe. CGFloat timestampLabelWidth = [self.timestampLabel sizeThatFits:CGSizeZero].width; - // Measuring the timestamp label's width is non-trivial since its - // contents can be relative the current time. We avoid having - // message bubbles' "visually vibrate" as their timestamp labels - // vary in width. So we try to leave enough space for all possible - // contents of this label _for the first hour of its lifetime_, when - // the timestamp is particularly volatile. - if ([DateUtil isTimestampFromLastHour:viewItem.interaction.timestamp]) { - // Measure the "now" case. - self.timestampLabel.text = [DateUtil exemplaryNowTimeFormat]; - timestampLabelWidth = MAX(timestampLabelWidth, [self.timestampLabel sizeThatFits:CGSizeZero].width); - // Measure the "relative time" case. - // Since this case varies with time, we multiply to leave - // space for the worst case (whose exact value, due to localization, - // is unpredictable). - self.timestampLabel.text = [DateUtil exemplaryMinutesTimeFormat]; - timestampLabelWidth = MAX(timestampLabelWidth, - [self.timestampLabel sizeThatFits:CGSizeZero].width + self.timestampLabel.font.lineHeight * 0.5f); - - // Re-configure the labels with the current appropriate value in case - // we are configuring this view for display. - [self configureLabelsWithConversationViewItem:viewItem]; - } - result.width = timestampLabelWidth; if (viewItem.interaction.interactionType == OWSInteractionType_OutgoingMessage) { if (![self isFailedOutgoingMessage:viewItem]) {