Rework conversation settings view.

pull/1/head
Matthew Chen 7 years ago
parent 306af29d6f
commit a16c2adda7

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "table_ic_notification_sound@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "table_ic_notification_sound@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "table_ic_notification_sound@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -477,11 +477,47 @@ NS_ASSUME_NONNULL_BEGIN
// Mute thread section.
OWSTableSection *muteSection = [OWSTableSection new];
// We need a section header to separate the mute UI from the group settings UI.
muteSection.headerTitle = NSLocalizedString(
@"CONVERSATION_SETTINGS_MUTE_SECTION", @"Title for the 'mute' section of the conversation settings view.");
[muteSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
OWSTableSection *notificationsSection = [OWSTableSection new];
// We need a section header to separate the notifications UI from the group settings UI.
notificationsSection.headerTitle = NSLocalizedString(
@"SETTINGS_SECTION_NOTIFICATIONS", @"Label for the notifications section of conversation settings view.");
[notificationsSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
OWSConversationSettingsViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
cell.preservesSuperviewLayoutMargins = YES;
cell.contentView.preservesSuperviewLayoutMargins = YES;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
UIImageView *iconView = [strongSelf viewForIconWithName:@"table_ic_notification_sound"];
[cell.contentView addSubview:iconView];
[iconView autoVCenterInSuperview];
[iconView autoPinLeadingToSuperview];
UILabel *rowLabel = [UILabel new];
rowLabel.text = NSLocalizedString(@"SETTINGS_ITEM_NOTIFICATION_SOUND",
@"Label for settings view that allows user to change the notification sound.");
rowLabel.textColor = [UIColor blackColor];
rowLabel.font = [UIFont ows_regularFontWithSize:17.f];
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[cell.contentView addSubview:rowLabel];
[rowLabel autoVCenterInSuperview];
[rowLabel autoPinLeadingToTrailingOfView:iconView margin:weakSelf.iconSpacing];
OWSSound sound = [OWSSounds notificationSoundForThread:self.thread];
cell.detailTextLabel.text = [OWSSounds displayNameForSound:sound];
return cell;
}
customRowHeight:45.f
actionBlock:^{
OWSSoundSettingsViewController *vc = [OWSSoundSettingsViewController new];
vc.soundType = OWSSoundType_Notification;
vc.thread = weakSelf.thread;
[weakSelf.navigationController pushViewController:vc animated:YES];
}]];
[notificationsSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
OWSConversationSettingsViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf);
@ -534,13 +570,13 @@ NS_ASSUME_NONNULL_BEGIN
cell.detailTextLabel.text = muteStatus;
return cell;
}
customRowHeight:45.f
actionBlock:^{
[weakSelf showMuteUnmuteActionSheet];
}]];
muteSection.footerTitle
customRowHeight:45.f
actionBlock:^{
[weakSelf showMuteUnmuteActionSheet];
}]];
notificationsSection.footerTitle
= NSLocalizedString(@"MUTE_BEHAVIOR_EXPLANATION", @"An explanation of the consequences of muting a thread.");
[contents addSection:muteSection];
[contents addSection:notificationsSection];
// Block user section.
@ -571,29 +607,6 @@ NS_ASSUME_NONNULL_BEGIN
[contents addSection:section];
}
// Sounds section.
OWSTableSection *soundsSection = [OWSTableSection new];
soundsSection.headerTitle = NSLocalizedString(@"SETTINGS_SECTION_SOUNDS",
@"Label for the sounds section of settings views.");
[soundsSection addItem:[OWSTableItem itemWithCustomCellBlock:^{
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1
reuseIdentifier:@"UITableViewCellStyleValue1"];
cell.textLabel.text = NSLocalizedString(@"SETTINGS_ITEM_NOTIFICATION_SOUND",
@"Label for settings view that allows user to change the notification sound.");
OWSSound sound = [OWSSounds notificationSoundForThread:self.thread];
cell.detailTextLabel.text = [OWSSounds displayNameForSound:sound];
[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
return cell;
}
actionBlock:^{
OWSSoundSettingsViewController *vc = [OWSSoundSettingsViewController new];
vc.soundType = OWSSoundType_Notification;
vc.thread = weakSelf.thread;
[weakSelf.navigationController pushViewController:vc animated:YES];
}]];
[contents addSection:soundsSection];
self.contents = contents;
}

@ -433,9 +433,6 @@
/* Label for button to mute a thread for a year. */
"CONVERSATION_SETTINGS_MUTE_ONE_YEAR_ACTION" = "Mute for one year";
/* Title for the 'mute' section of the conversation settings view. */
"CONVERSATION_SETTINGS_MUTE_SECTION" = "Mute";
/* Indicates that this thread is muted until a given date or time. Embeds {{The date or time which the thread is muted until}}. */
"CONVERSATION_SETTINGS_MUTED_UNTIL_FORMAT" = "until %@";
@ -1605,6 +1602,9 @@
/* Settings table section footer. */
"SETTINGS_SECTION_CALL_KIT_DESCRIPTION" = "iOS Call Integration shows Signal calls on your lock screen and in the system's call history. You may optionally show your contact's name and number. If iCloud is enabled, this call history will be shared with Apple.";
/* Label for the notifications section of conversation settings view. */
"SETTINGS_SECTION_NOTIFICATIONS" = "Notifications";
/* Label for the sounds section of settings views. */
"SETTINGS_SECTION_SOUNDS" = "Sounds";

Loading…
Cancel
Save