Merge branch 'charlesmchen/dynamicTypeFixes'

pull/1/head
Matthew Chen 7 years ago
commit 9e60a01143

@ -169,6 +169,9 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssert(interaction);
OWSAssert(label);
// Update cell to reflect changes in dynamic text.
self.titleLabel.font = [self titleFont];
// TODO: Should we move the copy generation into this view?
if ([interaction isKindOfClass:[TSErrorMessage class]]) {

@ -94,6 +94,10 @@ NS_ASSUME_NONNULL_BEGIN
self.titleLabel.text = [self titleForInteraction:interaction];
self.subtitleLabel.text = [self subtitleForInteraction:interaction];
// Update cell to reflect changes in dynamic text.
self.titleLabel.font = [self titleFont];
self.subtitleLabel.font = [self subtitleFont];
self.backgroundColor = [UIColor whiteColor];
[self setNeedsLayout];
@ -209,6 +213,10 @@ NS_ASSUME_NONNULL_BEGIN
TSUnreadIndicatorInteraction *interaction = (TSUnreadIndicatorInteraction *)self.viewItem.interaction;
// Update cell to reflect changes in dynamic text.
self.titleLabel.font = [self titleFont];
self.subtitleLabel.font = [self subtitleFont];
// TODO: Should we use viewWidth?
CGSize result = CGSizeMake(viewWidth, 0);
result.height += self.titleVMargin * 2.f;

@ -84,8 +84,10 @@ NS_ASSUME_NONNULL_BEGIN
[self.payloadView autoPinLeadingToTrailingEdgeOfView:self.avatarView offset:self.avatarHSpacing];
[self.payloadView autoVCenterInSuperview];
// Ensure that the cell's contents never overflow the cell bounds.
[self.payloadView autoPinEdgeToSuperviewMargin:ALEdgeTop relation:NSLayoutRelationGreaterThanOrEqual];
[self.payloadView autoPinEdgeToSuperviewMargin:ALEdgeBottom relation:NSLayoutRelationGreaterThanOrEqual];
//
// NOTE: It's critical that we pin to the superview top and bottom _edge_ and not _margin_.
[self.payloadView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:0 relation:NSLayoutRelationGreaterThanOrEqual];
[self.payloadView autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:0 relation:NSLayoutRelationGreaterThanOrEqual];
// We pin the payloadView traillingEdge later, as part of the "Unread Badge" logic.
self.nameLabel = [UILabel new];

@ -695,15 +695,19 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
UIStackView *stackView = [UIStackView new];
stackView.axis = UILayoutConstraintAxisHorizontal;
stackView.spacing = 5;
// If alignment isn't set, UIStackView uses the height of
// disclosureImageView, even if label has a higher desired height.
stackView.alignment = UIStackViewAlignmentCenter;
[stackView addArrangedSubview:label];
[stackView addArrangedSubview:disclosureImageView];
[cell.contentView addSubview:stackView];
[stackView autoCenterInSuperview];
// Constrain to cell margins.
[stackView autoPinEdgeToSuperviewMargin:ALEdgeTop relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeBottom relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeLeading relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewMargin:ALEdgeTrailing relation:NSLayoutRelationGreaterThanOrEqual];
// NOTE: It's critical that we pin to the superview top and bottom _edge_ and not _margin_.
[stackView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:0 relation:NSLayoutRelationGreaterThanOrEqual];
[stackView autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:0 relation:NSLayoutRelationGreaterThanOrEqual];
return cell;
}

Loading…
Cancel
Save