VoiceOver improvement

This commit is contained in:
Justin Mazzocchi 2021-02-22 19:24:57 -08:00
parent f4e9f26df4
commit 97bd008ea3
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C
3 changed files with 6 additions and 22 deletions

View file

@ -268,8 +268,6 @@
"status.bookmark" = "Bookmark";
"status.content-warning-abbreviation" = "CW";
"status.content-warning.accessibility" = "Content warning";
"status.content-warning.accessibility.closed" = "Closed";
"status.content-warning.accessibility.opened" = "Opened";
"status.delete" = "Delete";
"status.delete.confirm.post" = "Are you sure you want to delete this post?";
"status.delete.confirm.toot" = "Are you sure you want to delete this toot?";

View file

@ -67,6 +67,8 @@ final class StatusView: UIView {
if !statusConfiguration.viewModel.shouldShowContent {
statusConfiguration.viewModel.toggleShowContent()
UIAccessibility.post(notification: .screenChanged, argument: self)
return true
} else {
return super.accessibilityActivate()

View file

@ -63,29 +63,13 @@ final class StatusBodyView: UIView {
let accessibilityAttributedLabel = NSMutableAttributedString(string: "")
if !spoilerTextLabel.isHidden {
accessibilityAttributedLabel.append(mutableSpoilerText)
}
if !toggleShowContentButton.isHidden {
if !spoilerTextLabel.isHidden, !viewModel.shouldShowContent {
accessibilityAttributedLabel.appendWithSeparator(
NSLocalizedString("status.content-warning.accessibility", comment: ""))
if viewModel.shouldShowContent {
accessibilityAttributedLabel.appendWithSeparator(
NSLocalizedString("status.content-warning.accessibility.opened", comment: ""))
} else {
accessibilityAttributedLabel.appendWithSeparator(
NSLocalizedString("status.content-warning.accessibility.closed", comment: ""))
}
}
if !contentTextView.isHidden {
if spoilerTextLabel.isHidden {
accessibilityAttributedLabel.appendWithSeparator(mutableSpoilerText)
} else if !contentTextView.isHidden {
accessibilityAttributedLabel.append(mutableContent)
} else {
accessibilityAttributedLabel.appendWithSeparator(mutableContent)
}
}
for view in [attachmentsView, pollView, cardView] where !view.isHidden {