Respond to CR.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 90f959d0ab
commit f618f87825

@ -144,12 +144,6 @@
actionBlock:nil]]; actionBlock:nil]];
} }
[section addItem:[OWSTableItem
disclosureItemWithText:NSLocalizedString(@"PROFILE_VIEW_TITLE", @"Title for the profile view.")
actionBlock:^{
[weakSelf showProfile];
}]];
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_INVITE_TITLE", [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_INVITE_TITLE",
@"Settings table view cell label") @"Settings table view cell label")
actionBlock:^{ actionBlock:^{
@ -246,50 +240,50 @@
[cameraImageView autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:avatarView]; [cameraImageView autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:avatarView];
} }
UIView *threadNameView = [UIView containerView]; UIView *nameView = [UIView containerView];
[cell.contentView addSubview:threadNameView]; [cell.contentView addSubview:nameView];
[threadNameView autoVCenterInSuperview]; [nameView autoVCenterInSuperview];
[threadNameView autoPinTrailingToSuperView]; [nameView autoPinLeadingToTrailingOfView:avatarView margin:16.f];
[threadNameView autoPinLeadingToTrailingOfView:avatarView margin:16.f];
UILabel *threadTitleLabel = [UILabel new]; UILabel *titleLabel = [UILabel new];
NSString *_Nullable localProfileName = [OWSProfileManager.sharedManager localProfileName]; NSString *_Nullable localProfileName = [OWSProfileManager.sharedManager localProfileName];
if (localProfileName.length > 0) { if (localProfileName.length > 0) {
threadTitleLabel.text = localProfileName; titleLabel.text = localProfileName;
threadTitleLabel.textColor = [UIColor blackColor]; titleLabel.textColor = [UIColor blackColor];
threadTitleLabel.font = [UIFont ows_dynamicTypeTitle2Font]; titleLabel.font = [UIFont ows_dynamicTypeTitle2Font];
} else { } else {
threadTitleLabel.text = NSLocalizedString( titleLabel.text = NSLocalizedString(
@"APP_SETTINGS_EDIT_PROFILE_NAME_PROMPT", @"Text prompting user to edit their profile name."); @"APP_SETTINGS_EDIT_PROFILE_NAME_PROMPT", @"Text prompting user to edit their profile name.");
threadTitleLabel.textColor = [UIColor ows_materialBlueColor]; titleLabel.textColor = [UIColor ows_materialBlueColor];
threadTitleLabel.font = [UIFont ows_dynamicTypeHeadlineFont]; titleLabel.font = [UIFont ows_dynamicTypeHeadlineFont];
} }
threadTitleLabel.lineBreakMode = NSLineBreakByTruncatingTail; titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[threadNameView addSubview:threadTitleLabel]; [nameView addSubview:titleLabel];
[threadTitleLabel autoPinEdgeToSuperviewEdge:ALEdgeTop]; [titleLabel autoPinEdgeToSuperviewEdge:ALEdgeTop];
[threadTitleLabel autoPinWidthToSuperview]; [titleLabel autoPinWidthToSuperview];
__block UIView *lastTitleView = threadTitleLabel;
const CGFloat kSubtitlePointSize = 12.f; const CGFloat kSubtitlePointSize = 12.f;
void (^addSubtitle)(NSAttributedString *) = ^(NSAttributedString *subtitle) { UILabel *subtitleLabel = [UILabel new];
UILabel *subtitleLabel = [UILabel new]; subtitleLabel.textColor = [UIColor ows_darkGrayColor];
subtitleLabel.textColor = [UIColor ows_darkGrayColor]; subtitleLabel.font = [UIFont ows_regularFontWithSize:kSubtitlePointSize];
subtitleLabel.font = [UIFont ows_regularFontWithSize:kSubtitlePointSize]; subtitleLabel.attributedText = [[NSAttributedString alloc]
subtitleLabel.attributedText = subtitle;
subtitleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[threadNameView addSubview:subtitleLabel];
[subtitleLabel autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:lastTitleView];
[subtitleLabel autoPinLeadingToSuperView];
lastTitleView = subtitleLabel;
};
NSAttributedString *subtitle = [[NSAttributedString alloc]
initWithString:[PhoneNumber bestEffortFormatPartialUserSpecifiedTextToLookLikeAPhoneNumber:[TSAccountManager initWithString:[PhoneNumber bestEffortFormatPartialUserSpecifiedTextToLookLikeAPhoneNumber:[TSAccountManager
localNumber]]]; localNumber]]];
addSubtitle(subtitle); subtitleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[nameView addSubview:subtitleLabel];
[lastTitleView autoPinEdgeToSuperviewEdge:ALEdgeBottom]; [subtitleLabel autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:titleLabel];
[subtitleLabel autoPinLeadingToSuperView];
[subtitleLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom];
UIImage *disclosureImage = [UIImage imageNamed:(self.view.isRTL ? @"NavBarBack" : @"NavBarBackRTL")];
OWSAssert(disclosureImage);
UIImageView *disclosureButton =
[[UIImageView alloc] initWithImage:[disclosureImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]];
disclosureButton.tintColor = [UIColor colorWithRGBHex:0xcccccc];
[cell.contentView addSubview:disclosureButton];
[disclosureButton autoVCenterInSuperview];
[disclosureButton autoPinTrailingToSuperView];
[disclosureButton autoPinLeadingToTrailingOfView:nameView margin:16.f];
return cell; return cell;
} }

Loading…
Cancel
Save