Add accessibility identifiers to other settings views.

This commit is contained in:
Matthew Chen 2019-03-19 16:20:52 -04:00
parent b48e204b90
commit f1520d760e
4 changed files with 17 additions and 6 deletions

View File

@ -58,6 +58,7 @@
[informationSection addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_LEGAL_TERMS_CELL",
@"table cell label")
accessibilityIdentifier:SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, @"terms")
actionBlock:^{
[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:kLegalTermsUrlString]];
@ -68,6 +69,7 @@
OWSTableSection *helpSection = [OWSTableSection new];
helpSection.headerTitle = NSLocalizedString(@"SETTINGS_HELP_HEADER", @"");
[helpSection addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_SUPPORT", @"")
accessibilityIdentifier:SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, @"support")
actionBlock:^{
[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:@"https://support.signal.org"]];

View File

@ -89,16 +89,21 @@ NS_ASSUME_NONNULL_BEGIN
OWSTableSection *loggingSection = [OWSTableSection new];
loggingSection.headerTitle = NSLocalizedString(@"LOGGING_SECTION", nil);
[loggingSection addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_DEBUGLOG", @"")
isOnBlock:^{
return [OWSPreferences isLoggingEnabled];
}
target:weakSelf
selector:@selector(didToggleEnableLogSwitch:)]];
accessibilityIdentifier:SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, @"enable_debug_log")
isOnBlock:^{
return [OWSPreferences isLoggingEnabled];
}
isEnabledBlock:^{
return YES;
}
target:weakSelf
selector:@selector(didToggleEnableLogSwitch:)]];
if ([OWSPreferences isLoggingEnabled]) {
[loggingSection
addItem:[OWSTableItem actionItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_SUBMIT_DEBUGLOG", @"")
accessibilityIdentifier:SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, @"submit_debug_log")
actionBlock:^{
OWSLogInfo(@"Submitting debug logs");
[DDLog flushLog];
@ -112,6 +117,8 @@ NS_ASSUME_NONNULL_BEGIN
pushNotificationsSection.headerTitle
= NSLocalizedString(@"PUSH_REGISTER_TITLE", @"Used in table section header and alert view title contexts");
[pushNotificationsSection addItem:[OWSTableItem actionItemWithText:NSLocalizedString(@"REREGISTER_FOR_PUSH", nil)
accessibilityIdentifier:SUBVIEW_ACCESSIBILITY_IDENTIFIER(
self, @"reregister_push_notifications")
actionBlock:^{
[weakSelf syncPushTokens];
}]];
@ -180,6 +187,7 @@ NS_ASSUME_NONNULL_BEGIN
[censorshipSection
addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_CENSORSHIP_CIRCUMVENTION",
@"Label for the 'manual censorship circumvention' switch.")
accessibilityIdentifier:SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, @"censorship_circumvention")
isOnBlock:isCensorshipCircumventionOnBlock
isEnabledBlock:isManualCensorshipCircumventionOnEnabledBlock
target:weakSelf

View File

@ -327,6 +327,7 @@ int const OWSLinkedDevicesTableViewControllerSectionAddDevice = 1;
cell.detailTextLabel.text
= NSLocalizedString(@"LINK_NEW_DEVICE_SUBTITLE", @"Subheading for 'Link New Device' navigation");
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.accessibilityIdentifier = SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, @"add");
return cell;
} else if (indexPath.section == OWSLinkedDevicesTableViewControllerSectionExistingDevices) {
OWSDeviceTableViewCell *cell =

View File

@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
NSString *NSStringForNotificationType(NotificationType value)
{
switch (notificationType) {
switch (value) {
case NotificationNamePreview:
return @"NotificationNamePreview";
case NotificationNameNoPreview: