Merge branch 'charlesmchen/tweakMessageLayout'

pull/1/head
Matthew Chen 7 years ago
commit f9fc882864

@ -77,7 +77,6 @@ NS_ASSUME_NONNULL_BEGIN
self.footerLabel.hidden = YES;
[self.messageBubbleView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.dateHeaderLabel];
[self.footerView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.messageBubbleView];
[self.footerView autoPinEdgeToSuperviewEdge:ALEdgeBottom];
[self.footerView autoPinWidthToSuperview];
@ -270,23 +269,35 @@ NS_ASSUME_NONNULL_BEGIN
}
}
- (CGFloat)footerHeight
- (BOOL)shouldShowFooter
{
BOOL showFooter = NO;
BOOL hasExpirationTimer = self.message.shouldStartExpireTimer;
BOOL shouldShowFooter = NO;
if (hasExpirationTimer) {
showFooter = YES;
if (self.message.shouldStartExpireTimer) {
shouldShowFooter = YES;
} else if (self.isOutgoing) {
showFooter = !self.viewItem.shouldHideRecipientStatus;
shouldShowFooter = !self.viewItem.shouldHideRecipientStatus;
} else if (self.viewItem.isGroupThread) {
showFooter = YES;
shouldShowFooter = YES;
} else {
showFooter = NO;
shouldShowFooter = NO;
}
return (showFooter ? (CGFloat)ceil(MAX(kExpirationTimerViewSize, self.footerLabel.font.lineHeight)) : 0.f);
return shouldShowFooter;
}
- (CGFloat)footerHeight
{
if (!self.shouldShowFooter) {
return 0.f;
}
return ceil(MAX(kExpirationTimerViewSize, self.footerLabel.font.lineHeight));
}
- (CGFloat)footerVSpacing
{
return 1.f;
}
- (void)updateFooter
@ -313,11 +324,17 @@ NS_ASSUME_NONNULL_BEGIN
!attributedText) {
self.footerLabel.hidden = YES;
[self.viewConstraints addObjectsFromArray:@[
[self.footerView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.messageBubbleView],
[self.footerView autoSetDimension:ALDimensionHeight toSize:0],
]];
return;
}
[self.viewConstraints addObject:[self.footerView autoPinEdge:ALEdgeTop
toEdge:ALEdgeBottom
ofView:self.messageBubbleView
withOffset:self.footerVSpacing]];
if (hasExpirationTimer) {
uint64_t expirationTimestamp = message.expiresAt;
uint32_t expiresInSeconds = message.expiresInSeconds;
@ -388,7 +405,10 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssert(cellSize.width > 0 && cellSize.height > 0);
cellSize.height += self.dateHeaderHeight;
cellSize.height += self.footerHeight;
if (self.shouldShowFooter) {
cellSize.height += self.footerVSpacing;
cellSize.height += self.footerHeight;
}
if (self.shouldHaveFailedSendBadge) {
cellSize.width += self.failedSendBadgeSize;

@ -188,6 +188,7 @@ NS_ASSUME_NONNULL_BEGIN
UIView *quoteStripView = [UIView containerView];
quoteStripView.backgroundColor = self.highlightColor;
quoteStripView.userInteractionEnabled = NO;
quoteStripView.layer.cornerRadius = self.quotedReplyStripeRounding;
[stripeAndTextContainer addSubview:quoteStripView];
[quoteStripView autoPinHeightToSuperview];
[quoteStripView autoPinLeadingToSuperviewMargin];
@ -426,7 +427,6 @@ NS_ASSUME_NONNULL_BEGIN
return 8.f;
}
// TODO:
- (CGFloat)quotedAuthorBottomSpacing
{
return 3.f;
@ -444,7 +444,12 @@ NS_ASSUME_NONNULL_BEGIN
- (CGFloat)quotedReplyStripeVExtension
{
return 8.f;
return 4.f;
}
- (CGFloat)quotedReplyStripeRounding
{
return 1.f;
}
// The spacing between the vertical "quoted reply stripe"

Loading…
Cancel
Save