Merge branch 'mkirk/blocking8'

pull/1/head
Michael Kirk 8 years ago
commit e94cc18263

@ -71,16 +71,19 @@ NS_ASSUME_NONNULL_BEGIN
NSMutableAttributedString *attributedText = NSMutableAttributedString *attributedText =
[[contactsManager formattedFullNameForContact:contact font:self.nameLabel.font] mutableCopy]; [[contactsManager formattedFullNameForContact:contact font:self.nameLabel.font] mutableCopy];
if (self.isBlocked) { if (self.isBlocked) {
// Add whitespace between the contact name and the blocked indicator. UILabel *blockedLabel = [[UILabel alloc] init];
[attributedText appendAttributedString:[[NSAttributedString alloc] initWithString:@" " attributes:nil]]; blockedLabel.textAlignment = NSTextAlignmentRight;
[attributedText appendAttributedString:[[NSAttributedString alloc] blockedLabel.text
initWithString:NSLocalizedString(@"CONTACT_BLOCKED_INDICATOR", = NSLocalizedString(@"CONTACT_BLOCKED_INDICATOR", @"An indicator that a contact has been blocked.");
@"An indicator that a contact has been blocked.") blockedLabel.font = [UIFont ows_mediumFontWithSize:self.nameLabel.font.pointSize];
attributes:@{ blockedLabel.textColor = [UIColor blackColor];
NSFontAttributeName : [UIFont [self addSubview:blockedLabel];
ows_mediumFontWithSize:self.nameLabel.font.pointSize], [blockedLabel sizeToFit];
NSForegroundColorAttributeName : [UIColor blackColor], [blockedLabel autoVCenterInSuperview];
}]]; [blockedLabel autoPinEdgeToSuperviewMargin:ALEdgeRight];
[blockedLabel autoPinEdge:ALEdgeLeft toEdge:ALEdgeRight ofView:self.textLabel];
self.accessoryView = blockedLabel;
} }
self.nameLabel.attributedText = attributedText; self.nameLabel.attributedText = attributedText;
self.avatarView.image = self.avatarView.image =

Loading…
Cancel
Save