Refine table views.

pull/1/head
Matthew Chen 7 years ago
parent 0025999b22
commit 9f9e0965d5

@ -71,7 +71,7 @@
UILabel *copyrightLabel = [UILabel new];
copyrightLabel.text = NSLocalizedString(@"SETTINGS_COPYRIGHT", @"");
copyrightLabel.textColor = [UIColor ows_darkGrayColor];
copyrightLabel.textColor = [UIColor ows_themeSecondaryColor];
copyrightLabel.font = [UIFont ows_regularFontWithSize:15.0f];
copyrightLabel.numberOfLines = 2;
copyrightLabel.lineBreakMode = NSLineBreakByWordWrapping;

@ -60,18 +60,19 @@ NS_ASSUME_NONNULL_BEGIN
section.headerTitle = NSLocalizedString(
@"DOMAIN_FRONTING_COUNTRY_VIEW_SECTION_HEADER", @"Section title for the 'domain fronting country' view.");
for (OWSCountryMetadata *countryMetadata in [OWSCountryMetadata allCountryMetadatas]) {
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{
UITableViewCell *cell = [UITableViewCell new];
cell.textLabel.text = countryMetadata.localizedCountryName;
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
cell.textLabel.textColor = [UIColor blackColor];
if ([countryMetadata.countryCode isEqualToString:currentCountryCode]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
return cell;
}
[section addItem:[OWSTableItem
itemWithCustomCellBlock:^{
UITableViewCell *cell = [OWSTableItem newCell];
cell.textLabel.text = countryMetadata.localizedCountryName;
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
cell.textLabel.textColor = [UIColor blackColor];
if ([countryMetadata.countryCode isEqualToString:currentCountryCode]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
return cell;
}
actionBlock:^{
[weakSelf selectCountry:countryMetadata];
}]];

@ -33,14 +33,15 @@
@[ @(NotificationNamePreview), @(NotificationNameNoPreview), @(NotificationNoNameNoPreview) ]) {
NotificationType notificationType = (NotificationType)option.intValue;
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{
UITableViewCell *cell = [UITableViewCell new];
[[cell textLabel] setText:[prefs nameForNotificationPreviewType:notificationType]];
if (selectedNotifType == notificationType) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
return cell;
}
[section addItem:[OWSTableItem
itemWithCustomCellBlock:^{
UITableViewCell *cell = [OWSTableItem newCell];
[[cell textLabel] setText:[prefs nameForNotificationPreviewType:notificationType]];
if (selectedNotifType == notificationType) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
return cell;
}
actionBlock:^{
[weakSelf setNotificationType:notificationType];
}]];

@ -392,7 +392,7 @@ NS_ASSUME_NONNULL_BEGIN
@"A label that indicates the user has no Signal contacts.")
customRowHeight:UITableViewAutomaticDimension]];
} else {
UITableViewCell *loadingCell = [UITableViewCell new];
UITableViewCell *loadingCell = [OWSTableItem newCell];
OWSAssert(loadingCell.contentView);
UIActivityIndicatorView *activityIndicatorView =

@ -63,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN
self.title = NSLocalizedString(@"REGISTRATION_ENTER_LOCK_PIN_NAV_TITLE",
@"Navigation title shown when user is re-registering after having enabled registration lock");
self.view.backgroundColor = UIColor.whiteColor;
self.view.backgroundColor = [UIColor ows_themeBackgroundColor];
PinEntryView *entryView = [PinEntryView new];
self.entryView = entryView;

@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
{
[super viewDidLoad];
self.view.backgroundColor = UIColor.whiteColor;
self.view.backgroundColor = [UIColor ows_themeBackgroundColor];
self.title = NSLocalizedString(@"ENABLE_2FA_VIEW_TITLE", @"Title for the 'enable two factor auth PIN' views.");
@ -99,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN
- (UILabel *)createLabelWithText:(NSString *)text
{
UILabel *label = [UILabel new];
label.textColor = [UIColor blackColor];
label.textColor = [UIColor ows_themeForegroundColor];
label.text = text;
label.font = [UIFont ows_regularFontWithSize:ScaleFromIPhone5To7Plus(14.f, 16.f)];
label.numberOfLines = 0;
@ -112,7 +112,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)createPinTextfield
{
self.pinTextfield = [UITextField new];
self.pinTextfield.textColor = [UIColor blackColor];
self.pinTextfield.textColor = [UIColor ows_themeForegroundColor];
self.pinTextfield.font = [UIFont ows_mediumFontWithSize:ScaleFromIPhone5To7Plus(30.f, 36.f)];
self.pinTextfield.textAlignment = NSTextAlignmentCenter;
self.pinTextfield.keyboardType = UIKeyboardTypeNumberPad;

@ -368,7 +368,7 @@ const CGFloat kIconViewLength = 24;
[mainSection addItem:[OWSTableItem
itemWithCustomCellBlock:^{
UITableViewCell *cell = [UITableViewCell new];
UITableViewCell *cell = [OWSTableItem newCell];
OWSConversationSettingsViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
cell.preservesSuperviewLayoutMargins = YES;
@ -422,7 +422,7 @@ const CGFloat kIconViewLength = 24;
[mainSection
addItem:[OWSTableItem
itemWithCustomCellBlock:^{
UITableViewCell *cell = [UITableViewCell new];
UITableViewCell *cell = [OWSTableItem newCell];
OWSConversationSettingsViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
cell.preservesSuperviewLayoutMargins = YES;
@ -518,6 +518,7 @@ const CGFloat kIconViewLength = 24;
OWSCAssert(strongSelf);
cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES;
cell.backgroundColor = [UIColor ows_themeBackgroundColor];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
UIImageView *iconView = [strongSelf viewForIconWithName:@"table_ic_notification_sound"];
@ -556,6 +557,7 @@ const CGFloat kIconViewLength = 24;
OWSCAssert(strongSelf);
cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES;
cell.backgroundColor = [UIColor ows_themeBackgroundColor];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
UIImageView *iconView = [strongSelf viewForIconWithName:@"table_ic_mute_thread"];
@ -680,7 +682,7 @@ const CGFloat kIconViewLength = 24;
{
OWSAssert(name.length > 0);
UITableViewCell *cell = [UITableViewCell new];
UITableViewCell *cell = [OWSTableItem newCell];
cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES;

@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN
- (UILabel *)createLabelWithText:(nullable NSString *)text
{
UILabel *label = [UILabel new];
label.textColor = [UIColor blackColor];
label.textColor = [UIColor ows_themeForegroundColor];
label.text = text;
label.font = self.labelFont;
label.numberOfLines = 0;
@ -65,7 +65,7 @@ NS_ASSUME_NONNULL_BEGIN
self.pinTextfield = [UITextField new];
}
self.pinTextfield.textColor = [UIColor blackColor];
self.pinTextfield.textColor = [UIColor ows_themeForegroundColor];
self.pinTextfield.font = [UIFont ows_mediumFontWithSize:ScaleFromIPhone5To7Plus(30.f, 36.f)];
self.pinTextfield.textAlignment = NSTextAlignmentCenter;
self.pinTextfield.keyboardType = UIKeyboardTypeNumberPad;

@ -204,6 +204,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
item.customCellBlock = ^{
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1
reuseIdentifier:@"UITableViewCellStyleValue1"];
cell.backgroundColor = [UIColor ows_themeBackgroundColor];
cell.textLabel.text = text;
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
cell.textLabel.textColor = [UIColor ows_themeForegroundColor];

@ -71,21 +71,22 @@
OWSAssert([PhoneNumberUtil callingCodeFromCountryCode:countryCode].length > 0);
OWSAssert(![[PhoneNumberUtil callingCodeFromCountryCode:countryCode] isEqualToString:@"+0"]);
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{
UITableViewCell *cell = [UITableViewCell new];
cell.textLabel.text = [PhoneNumberUtil countryNameFromCountryCode:countryCode];
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
cell.textLabel.textColor = [UIColor blackColor];
UILabel *countryCodeLabel = [UILabel new];
countryCodeLabel.text = [PhoneNumberUtil callingCodeFromCountryCode:countryCode];
countryCodeLabel.font = [UIFont ows_regularFontWithSize:16.f];
countryCodeLabel.textColor = [UIColor ows_darkGrayColor];
[countryCodeLabel sizeToFit];
cell.accessoryView = countryCodeLabel;
return cell;
}
[section addItem:[OWSTableItem
itemWithCustomCellBlock:^{
UITableViewCell *cell = [OWSTableItem newCell];
cell.textLabel.text = [PhoneNumberUtil countryNameFromCountryCode:countryCode];
cell.textLabel.font = [UIFont ows_regularFontWithSize:18.f];
cell.textLabel.textColor = [UIColor blackColor];
UILabel *countryCodeLabel = [UILabel new];
countryCodeLabel.text = [PhoneNumberUtil callingCodeFromCountryCode:countryCode];
countryCodeLabel.font = [UIFont ows_regularFontWithSize:16.f];
countryCodeLabel.textColor = [UIColor ows_darkGrayColor];
[countryCodeLabel sizeToFit];
cell.accessoryView = countryCodeLabel;
return cell;
}
actionBlock:^{
[weakSelf countryCodeWasSelected:countryCode];
}]];

@ -55,7 +55,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
{
[super loadView];
self.view.backgroundColor = [UIColor whiteColor];
self.view.backgroundColor = [UIColor ows_themeBackgroundColor];
_contactsViewHelper = [[ContactsViewHelper alloc] initWithDelegate:self];
@ -97,6 +97,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
[_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom];
self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableViewController.tableView.estimatedRowHeight = 60;
_tableViewController.view.backgroundColor = [UIColor ows_themeBackgroundColor];
[self updateTableContents];
@ -107,7 +108,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
{
UILabel *countryCodeLabel = [UILabel new];
countryCodeLabel.font = [UIFont ows_mediumFontWithSize:18.f];
countryCodeLabel.textColor = [UIColor blackColor];
countryCodeLabel.textColor = [UIColor ows_themeForegroundColor];
countryCodeLabel.text
= NSLocalizedString(@"REGISTRATION_DEFAULT_COUNTRY_NAME", @"Label for the country code field");
return countryCodeLabel;
@ -132,7 +133,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
{
UILabel *phoneNumberLabel = [UILabel new];
phoneNumberLabel.font = [UIFont ows_mediumFontWithSize:18.f];
phoneNumberLabel.textColor = [UIColor blackColor];
phoneNumberLabel.textColor = [UIColor ows_themeForegroundColor];
phoneNumberLabel.text
= NSLocalizedString(@"REGISTRATION_PHONENUMBER_BUTTON", @"Label for the phone number textfield");
return phoneNumberLabel;
@ -148,7 +149,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
if (!_examplePhoneNumberLabel) {
_examplePhoneNumberLabel = [UILabel new];
_examplePhoneNumberLabel.font = [self examplePhoneNumberFont];
_examplePhoneNumberLabel.textColor = [UIColor colorWithWhite:0.5f alpha:1.f];
_examplePhoneNumberLabel.textColor = [UIColor ows_themeSecondaryColor];
}
return _examplePhoneNumberLabel;
@ -391,8 +392,8 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
{
BOOL isEnabled = [self hasValidPhoneNumber];
self.phoneNumberButton.enabled = isEnabled;
[self.phoneNumberButton
setBackgroundColorsWithUpColor:(isEnabled ? [UIColor ows_signalBrandBlueColor] : [UIColor lightGrayColor])];
[self.phoneNumberButton setBackgroundColorsWithUpColor:(isEnabled ? [UIColor ows_signalBrandBlueColor]
: [UIColor ows_themeSecondaryColor])];
}
#pragma mark - CountryCodeViewControllerDelegate
@ -457,7 +458,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
SelectRecipientViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
UITableViewCell *cell = [UITableViewCell new];
UITableViewCell *cell = [OWSTableItem newCell];
cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES;

Loading…
Cancel
Save