Fix dynamic type issues.

pull/1/head
Matthew Chen 7 years ago
parent 023d40e230
commit fb0c47aa12

@ -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;

@ -94,6 +94,10 @@ NS_ASSUME_NONNULL_BEGIN
[self.nameLabel setContentHuggingHorizontalLow];
[self.nameLabel setCompressionResistanceHorizontalLow];
[self.contentView addBorderWithColor:[UIColor blueColor]];
[self.nameLabel addRedBorder];
[self.snippetLabel addRedBorder];
self.dateTimeLabel = [UILabel new];
[self.dateTimeLabel setContentHuggingHorizontalHigh];
[self.dateTimeLabel setCompressionResistanceHorizontalHigh];
@ -125,6 +129,14 @@ NS_ASSUME_NONNULL_BEGIN
[self.unreadLabel autoCenterInSuperview];
[self.unreadLabel setContentHuggingHigh];
[self.unreadLabel setCompressionResistanceHigh];
UIView *payloadBorderView = [UIView new];
[payloadBorderView addBorderWithColor:[UIColor greenColor]];
[self.contentView addSubview:payloadBorderView];
[payloadBorderView autoPinEdge:ALEdgeTop toEdge:ALEdgeTop ofView:self.payloadView];
[payloadBorderView autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.payloadView];
[payloadBorderView autoPinEdge:ALEdgeLeft toEdge:ALEdgeLeft ofView:self.payloadView];
[payloadBorderView autoPinEdge:ALEdgeRight toEdge:ALEdgeRight ofView:self.payloadView];
}
+ (NSString *)cellReuseIdentifier

Loading…
Cancel
Save