Update disappearing messages icon.

pull/1/head
Matthew Chen 7 years ago
parent 5caa289bc3
commit 9494023107

@ -2,17 +2,17 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "ic_timer.png", "filename" : "timer-48@1x.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "ic_timer@2x.png", "filename" : "timer-48@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "ic_timer@3x.png", "filename" : "timer-48@3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

@ -363,8 +363,8 @@ const CGFloat kIconViewLength = 24;
}]]; }]];
} }
[mainSection [mainSection addItem:[OWSTableItem
addItem:[OWSTableItem itemWithCustomCellBlock:^{ itemWithCustomCellBlock:^{
UITableViewCell *cell = [UITableViewCell new]; UITableViewCell *cell = [UITableViewCell new];
OWSConversationSettingsViewController *strongSelf = weakSelf; OWSConversationSettingsViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf); OWSCAssert(strongSelf);
@ -384,9 +384,10 @@ const CGFloat kIconViewLength = 24;
[iconView autoPinLeadingToSuperviewMargin]; [iconView autoPinLeadingToSuperviewMargin];
UILabel *rowLabel = [UILabel new]; UILabel *rowLabel = [UILabel new];
rowLabel.text = NSLocalizedString(@"DISAPPEARING_MESSAGES", @"table cell label in conversation settings"); rowLabel.text = NSLocalizedString(
@"DISAPPEARING_MESSAGES", @"table cell label in conversation settings");
rowLabel.textColor = [UIColor blackColor]; rowLabel.textColor = [UIColor blackColor];
rowLabel.font = [UIFont ows_regularFontWithSize:17.f]; rowLabel.font = [UIFont ows_dynamicTypeBodyFont];
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail; rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[topView addSubview:rowLabel]; [topView addSubview:rowLabel];
[rowLabel autoVCenterInSuperview]; [rowLabel autoVCenterInSuperview];
@ -403,21 +404,21 @@ const CGFloat kIconViewLength = 24;
[switchView autoPinTrailingToSuperviewMargin]; [switchView autoPinTrailingToSuperviewMargin];
UILabel *subtitleLabel = [UILabel new]; UILabel *subtitleLabel = [UILabel new];
subtitleLabel.text subtitleLabel.text = NSLocalizedString(
= NSLocalizedString(@"DISAPPEARING_MESSAGES_DESCRIPTION", @"subheading in conversation settings"); @"DISAPPEARING_MESSAGES_DESCRIPTION", @"subheading in conversation settings");
subtitleLabel.textColor = [UIColor blackColor]; subtitleLabel.textColor = [UIColor blackColor];
subtitleLabel.font = [UIFont ows_regularFontWithSize:11.f]; subtitleLabel.font = [UIFont ows_dynamicTypeCaption1Font];
subtitleLabel.numberOfLines = 0; subtitleLabel.numberOfLines = 0;
subtitleLabel.lineBreakMode = NSLineBreakByWordWrapping; subtitleLabel.lineBreakMode = NSLineBreakByWordWrapping;
[cell.contentView addSubview:subtitleLabel]; [cell.contentView addSubview:subtitleLabel];
[subtitleLabel autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:topView]; [subtitleLabel autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:topView];
[subtitleLabel autoPinEdge:ALEdgeLeading toEdge:ALEdgeLeading ofView:rowLabel]; [subtitleLabel autoPinEdge:ALEdgeLeading toEdge:ALEdgeLeading ofView:rowLabel];
[subtitleLabel autoPinTrailingToSuperviewMargin]; [subtitleLabel autoPinTrailingToSuperviewMargin];
[subtitleLabel autoPinBottomToSuperviewMargin];
return cell; return cell;
} }
// TODO: We shouldn't hard-code a row height that will contain the cell content. customRowHeight:UITableViewAutomaticDimension
customRowHeight:108.f
actionBlock:nil]]; actionBlock:nil]];
if (self.disappearingMessagesConfiguration.isEnabled) { if (self.disappearingMessagesConfiguration.isEnabled) {
@ -445,7 +446,7 @@ const CGFloat kIconViewLength = 24;
UILabel *rowLabel = strongSelf.disappearingMessagesDurationLabel; UILabel *rowLabel = strongSelf.disappearingMessagesDurationLabel;
[strongSelf updateDisappearingMessagesDurationLabel]; [strongSelf updateDisappearingMessagesDurationLabel];
rowLabel.textColor = [UIColor blackColor]; rowLabel.textColor = [UIColor blackColor];
rowLabel.font = [UIFont ows_regularFontWithSize:11.f]; rowLabel.font = [UIFont ows_dynamicTypeBodyFont];
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail; rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[topView addSubview:rowLabel]; [topView addSubview:rowLabel];
[rowLabel autoVCenterInSuperview]; [rowLabel autoVCenterInSuperview];
@ -463,11 +464,11 @@ const CGFloat kIconViewLength = 24;
[slider autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:topView]; [slider autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:topView];
[slider autoPinEdge:ALEdgeLeading toEdge:ALEdgeLeading ofView:rowLabel]; [slider autoPinEdge:ALEdgeLeading toEdge:ALEdgeLeading ofView:rowLabel];
[slider autoPinTrailingToSuperviewMargin]; [slider autoPinTrailingToSuperviewMargin];
[slider autoPinBottomToSuperviewMargin];
return cell; return cell;
} }
// TODO: We shouldn't hard-code a row height that will contain the cell content. customRowHeight:UITableViewAutomaticDimension
customRowHeight:84.f
actionBlock:nil]]; actionBlock:nil]];
} }
@ -515,8 +516,11 @@ const CGFloat kIconViewLength = 24;
notificationsSection.headerTitle = NSLocalizedString( notificationsSection.headerTitle = NSLocalizedString(
@"SETTINGS_SECTION_NOTIFICATIONS", @"Label for the notifications section of conversation settings view."); @"SETTINGS_SECTION_NOTIFICATIONS", @"Label for the notifications section of conversation settings view.");
[notificationsSection addItem:[OWSTableItem itemWithCustomCellBlock:^{ [notificationsSection
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil]; addItem:[OWSTableItem
itemWithCustomCellBlock:^{
UITableViewCell *cell =
[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
OWSConversationSettingsViewController *strongSelf = weakSelf; OWSConversationSettingsViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf); OWSCAssert(strongSelf);
cell.preservesSuperviewLayoutMargins = YES; cell.preservesSuperviewLayoutMargins = YES;
@ -532,7 +536,7 @@ const CGFloat kIconViewLength = 24;
rowLabel.text = NSLocalizedString(@"SETTINGS_ITEM_NOTIFICATION_SOUND", rowLabel.text = NSLocalizedString(@"SETTINGS_ITEM_NOTIFICATION_SOUND",
@"Label for settings view that allows user to change the notification sound."); @"Label for settings view that allows user to change the notification sound.");
rowLabel.textColor = [UIColor blackColor]; rowLabel.textColor = [UIColor blackColor];
rowLabel.font = [UIFont ows_regularFontWithSize:17.f]; rowLabel.font = [UIFont ows_dynamicTypeBodyFont];
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail; rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[cell.contentView addSubview:rowLabel]; [cell.contentView addSubview:rowLabel];
[rowLabel autoVCenterInSuperview]; [rowLabel autoVCenterInSuperview];
@ -542,15 +546,18 @@ const CGFloat kIconViewLength = 24;
cell.detailTextLabel.text = [OWSSounds displayNameForSound:sound]; cell.detailTextLabel.text = [OWSSounds displayNameForSound:sound];
return cell; return cell;
} }
customRowHeight:45.f customRowHeight:UITableViewAutomaticDimension
actionBlock:^{ actionBlock:^{
OWSSoundSettingsViewController *vc = [OWSSoundSettingsViewController new]; OWSSoundSettingsViewController *vc = [OWSSoundSettingsViewController new];
vc.thread = weakSelf.thread; vc.thread = weakSelf.thread;
[weakSelf.navigationController pushViewController:vc animated:YES]; [weakSelf.navigationController pushViewController:vc animated:YES];
}]]; }]];
[notificationsSection addItem:[OWSTableItem itemWithCustomCellBlock:^{ [notificationsSection
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil]; addItem:[OWSTableItem
itemWithCustomCellBlock:^{
UITableViewCell *cell =
[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
OWSConversationSettingsViewController *strongSelf = weakSelf; OWSConversationSettingsViewController *strongSelf = weakSelf;
OWSCAssert(strongSelf); OWSCAssert(strongSelf);
cell.preservesSuperviewLayoutMargins = YES; cell.preservesSuperviewLayoutMargins = YES;
@ -563,26 +570,28 @@ const CGFloat kIconViewLength = 24;
[iconView autoPinLeadingToSuperviewMargin]; [iconView autoPinLeadingToSuperviewMargin];
UILabel *rowLabel = [UILabel new]; UILabel *rowLabel = [UILabel new];
rowLabel.text = NSLocalizedString( rowLabel.text = NSLocalizedString(@"CONVERSATION_SETTINGS_MUTE_LABEL",
@"CONVERSATION_SETTINGS_MUTE_LABEL", @"label for 'mute thread' cell in conversation settings"); @"label for 'mute thread' cell in conversation settings");
rowLabel.textColor = [UIColor blackColor]; rowLabel.textColor = [UIColor blackColor];
rowLabel.font = [UIFont ows_regularFontWithSize:17.f]; rowLabel.font = [UIFont ows_dynamicTypeBodyFont];
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail; rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[cell.contentView addSubview:rowLabel]; [cell.contentView addSubview:rowLabel];
[rowLabel autoVCenterInSuperview]; [rowLabel autoVCenterInSuperview];
[rowLabel autoPinLeadingToTrailingEdgeOfView:iconView offset:weakSelf.iconSpacing]; [rowLabel autoPinLeadingToTrailingEdgeOfView:iconView offset:weakSelf.iconSpacing];
NSString *muteStatus = NSLocalizedString( NSString *muteStatus = NSLocalizedString(@"CONVERSATION_SETTINGS_MUTE_NOT_MUTED",
@"CONVERSATION_SETTINGS_MUTE_NOT_MUTED", @"Indicates that the current thread is not muted."); @"Indicates that the current thread is not muted.");
NSDate *mutedUntilDate = strongSelf.thread.mutedUntilDate; NSDate *mutedUntilDate = strongSelf.thread.mutedUntilDate;
NSDate *now = [NSDate date]; NSDate *now = [NSDate date];
if (mutedUntilDate != nil && [mutedUntilDate timeIntervalSinceDate:now] > 0) { if (mutedUntilDate != nil && [mutedUntilDate timeIntervalSinceDate:now] > 0) {
NSCalendar *calendar = [NSCalendar currentCalendar]; NSCalendar *calendar = [NSCalendar currentCalendar];
NSCalendarUnit calendarUnits = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay; NSCalendarUnit calendarUnits = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay;
NSDateComponents *muteUntilComponents = [calendar components:calendarUnits fromDate:mutedUntilDate]; NSDateComponents *muteUntilComponents =
[calendar components:calendarUnits fromDate:mutedUntilDate];
NSDateComponents *nowComponents = [calendar components:calendarUnits fromDate:now]; NSDateComponents *nowComponents = [calendar components:calendarUnits fromDate:now];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
if (nowComponents.year != muteUntilComponents.year || nowComponents.month != muteUntilComponents.month if (nowComponents.year != muteUntilComponents.year
|| nowComponents.month != muteUntilComponents.month
|| nowComponents.day != muteUntilComponents.day) { || nowComponents.day != muteUntilComponents.day) {
[dateFormatter setDateStyle:NSDateFormatterShortStyle]; [dateFormatter setDateStyle:NSDateFormatterShortStyle];
@ -592,8 +601,8 @@ const CGFloat kIconViewLength = 24;
[dateFormatter setTimeStyle:NSDateFormatterShortStyle]; [dateFormatter setTimeStyle:NSDateFormatterShortStyle];
} }
muteStatus = muteStatus = [NSString
[NSString stringWithFormat:NSLocalizedString(@"CONVERSATION_SETTINGS_MUTED_UNTIL_FORMAT", stringWithFormat:NSLocalizedString(@"CONVERSATION_SETTINGS_MUTED_UNTIL_FORMAT",
@"Indicates that this thread is muted until a given date or time. " @"Indicates that this thread is muted until a given date or time. "
@"Embeds {{The date or time which the thread is muted until}}."), @"Embeds {{The date or time which the thread is muted until}}."),
[dateFormatter stringFromDate:mutedUntilDate]]; [dateFormatter stringFromDate:mutedUntilDate]];
@ -602,7 +611,7 @@ const CGFloat kIconViewLength = 24;
cell.detailTextLabel.text = muteStatus; cell.detailTextLabel.text = muteStatus;
return cell; return cell;
} }
customRowHeight:45.f customRowHeight:UITableViewAutomaticDimension
actionBlock:^{ actionBlock:^{
[weakSelf showMuteUnmuteActionSheet]; [weakSelf showMuteUnmuteActionSheet];
}]]; }]];
@ -687,7 +696,7 @@ const CGFloat kIconViewLength = 24;
UILabel *rowLabel = [UILabel new]; UILabel *rowLabel = [UILabel new];
rowLabel.text = name; rowLabel.text = name;
rowLabel.textColor = [UIColor blackColor]; rowLabel.textColor = [UIColor blackColor];
rowLabel.font = [UIFont ows_regularFontWithSize:17.f]; rowLabel.font = [UIFont ows_dynamicTypeBodyFont];
rowLabel.lineBreakMode = NSLineBreakByTruncatingTail; rowLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[cell.contentView addSubview:rowLabel]; [cell.contentView addSubview:rowLabel];
[rowLabel autoVCenterInSuperview]; [rowLabel autoVCenterInSuperview];

Loading…
Cancel
Save