Improve accessibility a bit

This commit is contained in:
Josh Schneier 2016-12-06 21:27:07 -05:00 committed by Michael Kirk
parent e2d725a041
commit 89730f2b85
3 changed files with 32 additions and 2 deletions

View File

@ -236,6 +236,8 @@ typedef enum : NSUInteger {
self.messageAdapterCache = [[NSCache alloc] init];
_attachButton = [[UIButton alloc] init];
_attachButton.accessibilityLabel = NSLocalizedString(@"ATTACHMENT_LABEL", @"Accessibility label for attaching photos");
_attachButton.accessibilityHint = NSLocalizedString(@"ATTACHMENT_HINT", @"Accessibility hint describing what you can do with the attachment button");
[_attachButton setFrame:CGRectMake(0,
0,
JSQ_TOOLBAR_ICON_WIDTH + JSQ_IMAGE_INSET * 2,
@ -498,6 +500,7 @@ typedef enum : NSUInteger {
style:UIBarButtonItemStylePlain
target:self
action:@selector(callAction)];
callButton.accessibilityLabel = NSLocalizedString(@"CALL_LABEL", "Accessibilty label for placing call button");
callButton.imageInsets = UIEdgeInsetsMake(0, -10, 0, 10);
[barButtons addObject:callButton];
} else if ([self.thread isGroupThread]) {
@ -508,14 +511,19 @@ typedef enum : NSUInteger {
action:@selector(didTapManageGroupButton:)];
// Hack to shrink button image
manageGroupButton.imageInsets = UIEdgeInsetsMake(10, 20, 10, 0);
manageGroupButton.accessibilityLabel = NSLocalizedString(@"GROUP_SETTINGS_LABEL", @"Accessibilty label for group settings");
[barButtons addObject:manageGroupButton];
}
if (disappearingMessagesConfiguration.isEnabled) {
[barButtons addObject:[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_timer"]
UIBarButtonItem *timerButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_timer"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(didTapTimerInNavbar)]];
action:@selector(didTapTimerInNavbar)];
timerButton.accessibilityLabel = NSLocalizedString(@"DISAPPEARING_MESSAGES_LABEL", @"Accessibility label for disappearing messages");
NSString *formatString = NSLocalizedString(@"DISAPPEARING_MESSAGES_HINT", @"Accessibility hint that contains current timeout information");
timerButton.accessibilityHint = [NSString stringWithFormat:formatString, [disappearingMessagesConfiguration durationString]];
[barButtons addObject:timerButton];
}
self.navigationItem.rightBarButtonItems = [barButtons copy];

View File

@ -110,6 +110,7 @@ static NSString *const kUnwindToMessagesViewSegue = @"UnwindToMessagesViewSegue"
action:@selector(createGroup)];
self.navigationItem.rightBarButtonItem.imageInsets = UIEdgeInsetsMake(0, -10, 0, 10);
self.navigationItem.title = NSLocalizedString(@"NEW_GROUP_DEFAULT_TITLE", @"");
self.navigationItem.rightBarButtonItem.accessibilityLabel = NSLocalizedString(@"FINISH_GROUP_CREATION_LABEL", @"Accessibilty label for finishing new group");
} else {
self.navigationItem.rightBarButtonItem =
[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"UPDATE_BUTTON_TITLE", @"")

View File

@ -52,12 +52,21 @@
/* No comment provided by engineer. */
"ATTACHMENT_DOWNLOADING" = "Attachment is downloading";
/* Accessibility hint describing what you can do with the attachment button */
"ATTACHMENT_HINT" = "Choose or take a picture and then send it";
/* Accessibility label for attaching photos */
"ATTACHMENT_LABEL" = "Attachment";
/* No comment provided by engineer. */
"ATTACHMENT_QUEUED" = "New attachment queued for retrieval.";
/* No comment provided by engineer. */
"AUDIO_PERMISSION_MESSAGE" = "Signal requires access to your microphone to work properly. You can restore the permission in the Settings app >> Privacy >> Microphone >> Signal";
/* Accessibilty label for placing call button */
"CALL_LABEL" = "Call";
/* No comment provided by engineer. */
"CALLBACK_BUTTON_TITLE" = "Call back";
@ -121,6 +130,12 @@
/* subheading in conversation settings */
"DISAPPEARING_MESSAGES_DESCRIPTION" = "When enabled, messages sent and received in this conversation will disappear after they have been seen.";
/* Accessibility hint that contains current timeout information */
"DISAPPEARING_MESSAGES_HINT" = "Currently messages disappear after %@";
/* Accessibility label for disappearing messages */
"DISAPPEARING_MESSAGES_LABEL" = "Disappearing messages settings";
/* Generic short text for button to dismiss a dialog */
"DISMISS_BUTTON_TEXT" = "Dismiss";
@ -265,6 +280,9 @@
/* No comment provided by engineer. */
"FINGERPRINT_SHRED_KEYMATERIAL_BUTTON" = "Reset this session.";
/* Accessibilty label for finishing new group */
"FINISH_GROUP_CREATION_LABEL" = "Finish creating group";
/* No comment provided by engineer. */
"GROUP_AVATAR_CHANGED" = "Avatar changed. ";
@ -295,6 +313,9 @@
/* No comment provided by engineer. */
"GROUP_REMOVING_FAILED" = "Failed to leave group";
/* Accessibilty label for group settings */
"GROUP_SETTINGS_LABEL" = "Group settings";
/* No comment provided by engineer. */
"GROUP_TITLE_CHANGED" = "Title is now '%@'. ";