VoiceOver improvements

This commit is contained in:
Justin Mazzocchi 2021-02-02 22:00:29 -08:00
parent 0f53a1b676
commit 48c014ba35
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
3 changed files with 7 additions and 12 deletions

View File

@ -91,8 +91,7 @@
"compose.poll-button.accessibility-label" = "Add a poll"; "compose.poll-button.accessibility-label" = "Add a poll";
"compose.prompt" = "What's on your mind?"; "compose.prompt" = "What's on your mind?";
"compose.take-photo-or-video" = "Take Photo or Video"; "compose.take-photo-or-video" = "Take Photo or Video";
"compose.visibility-button.accessibility-label.toot" = "Adjust toot privacy"; "compose.visibility-button.accessibility-label-%@" = "Privacy: %@";
"compose.visibility-button.accessibility-label.post" = "Adjust post privacy";
"compose-button.accessibility-label.post" = "Compose Post"; "compose-button.accessibility-label.post" = "Compose Post";
"compose-button.accessibility-label.toot" = "Compose Toot"; "compose-button.accessibility-label.toot" = "Compose Toot";
"emoji.custom" = "Custom"; "emoji.custom" = "Custom";

View File

@ -83,15 +83,6 @@ private extension CompositionInputAccessoryView {
image: UIImage(systemName: parentViewModel.visibility.systemImageName), image: UIImage(systemName: parentViewModel.visibility.systemImageName),
menu: visibilityMenu(selectedVisibility: parentViewModel.visibility)) menu: visibilityMenu(selectedVisibility: parentViewModel.visibility))
switch parentViewModel.identityContext.appPreferences.statusWord {
case .toot:
visibilityButton.accessibilityLabel =
NSLocalizedString("compose.visibility-button.accessibility-label.toot", comment: "")
case .post:
visibilityButton.accessibilityLabel =
NSLocalizedString("compose.visibility-button.accessibility-label.post", comment: "")
}
let contentWarningButton = UIBarButtonItem( let contentWarningButton = UIBarButtonItem(
title: NSLocalizedString("status.content-warning-abbreviation", comment: ""), title: NSLocalizedString("status.content-warning-abbreviation", comment: ""),
primaryAction: UIAction { [weak self] _ in self?.viewModel.displayContentWarning.toggle() }) primaryAction: UIAction { [weak self] _ in self?.viewModel.displayContentWarning.toggle() })
@ -183,6 +174,9 @@ private extension CompositionInputAccessoryView {
.sink { [weak self] in .sink { [weak self] in
visibilityButton.image = UIImage(systemName: $0.systemImageName) visibilityButton.image = UIImage(systemName: $0.systemImageName)
visibilityButton.menu = self?.visibilityMenu(selectedVisibility: $0) visibilityButton.menu = self?.visibilityMenu(selectedVisibility: $0)
visibilityButton.accessibilityLabel = String.localizedStringWithFormat(
NSLocalizedString("compose.visibility-button.accessibility-label-%@", comment: ""),
$0.title ?? "")
} }
.store(in: &cancellables) .store(in: &cancellables)
} }

View File

@ -400,6 +400,8 @@ private extension StatusView {
infoLabel.isHidden = false infoLabel.isHidden = false
infoIcon.isHidden = false infoIcon.isHidden = false
} else { } else {
infoLabel.text = nil
infoIcon.image = nil
infoLabel.isHidden = true infoLabel.isHidden = true
infoIcon.isHidden = true infoIcon.isHidden = true
} }
@ -494,7 +496,7 @@ private extension StatusView {
let accessibilityAttributedLabel = NSMutableAttributedString(string: "") let accessibilityAttributedLabel = NSMutableAttributedString(string: "")
if let infoText = infoLabel.attributedText { if !infoLabel.isHidden, let infoText = infoLabel.attributedText {
accessibilityAttributedLabel.appendWithSeparator(infoText) accessibilityAttributedLabel.appendWithSeparator(infoText)
} }