Update disappearing messages icon.

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

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

Loading…
Cancel
Save