From bf3a67344399b490bd762298a9791ab25a5ed705 Mon Sep 17 00:00:00 2001 From: Darren W Date: Tue, 31 Jan 2017 12:59:39 +0900 Subject: [PATCH] Add accessibility labels for the Create New Group and Settings navigation bar buttons. FREEBIE. --- .../view controllers/MessageComposeTableViewController.m | 3 +++ Signal/src/view controllers/SignalsViewController.m | 6 ++++-- Signal/translations/en.lproj/Localizable.strings | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Signal/src/view controllers/MessageComposeTableViewController.m b/Signal/src/view controllers/MessageComposeTableViewController.m index b18d92c87..ed8d5bf59 100644 --- a/Signal/src/view controllers/MessageComposeTableViewController.m +++ b/Signal/src/view controllers/MessageComposeTableViewController.m @@ -119,6 +119,9 @@ NSString *const MessageComposeTableViewControllerCellContact = @"ContactTableVie [self.navigationController.navigationBar setTranslucent:NO]; [self useOWSBackButton]; + self.navigationItem.rightBarButtonItem.accessibilityLabel = NSLocalizedString( + @"CREATE_NEW_GROUP", @"Accessibility label for the create group new group button"); + self.tableView.estimatedRowHeight = (CGFloat)60.0; self.tableView.rowHeight = UITableViewAutomaticDimension; diff --git a/Signal/src/view controllers/SignalsViewController.m b/Signal/src/view controllers/SignalsViewController.m index 708d18c64..2cfc776c1 100644 --- a/Signal/src/view controllers/SignalsViewController.m +++ b/Signal/src/view controllers/SignalsViewController.m @@ -117,9 +117,11 @@ NSString *const SignalsViewControllerSegueShowIncomingCall = @"ShowIncomingCallS [self.segmentedControl addTarget:self action:@selector(swappedSegmentedControl) forControlEvents:UIControlEventValueChanged]; - self.navigationItem.titleView = self.segmentedControl; + UINavigationItem *navigationItem = self.navigationItem; + navigationItem.titleView = self.segmentedControl; [self.segmentedControl setSelectedSegmentIndex:0]; - + navigationItem.leftBarButtonItem.accessibilityLabel = NSLocalizedString( + @"SETTINGS_BUTTON_ACCESSIBILITY", @"Accessibility hint for the settings button"); if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)] && (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)) { diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 302c2f4fd..e38282f0e 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -124,6 +124,9 @@ /* No comment provided by engineer. */ "COUNTRYCODE_SELECT_TITLE" = "Select Country Code"; +/* Accessibility label for the create new group button. */ +"CREATE_NEW_GROUP" = "Create new group"; + /* {{number of days}} embedded in strings, e.g. 'Alice updated disappearing messages expiration to {{5 days}}'. See other *_TIME_AMOUNT strings */ "DAYS_TIME_AMOUNT" = "%u days"; @@ -780,6 +783,9 @@ /* Table cell label */ "SETTINGS_BLOCK_ON_IDENTITY_CHANGE_TITLE" = "Require Approval on Change"; +/* Settings button accessibility hint */ +"SETTINGS_BUTTON_ACCESSIBILITY" = "Settings"; + /* No comment provided by engineer. */ "SETTINGS_CLEAR_HISTORY" = "Clear History Logs";