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.bookmark" = "Bookmark";
"status.content-warning-abbreviation" = "CW"; "status.content-warning-abbreviation" = "CW";
"status.content-warning.accessibility" = "Content warning"; "status.content-warning.accessibility" = "Content warning";
"status.content-warning.accessibility.closed" = "Closed";
"status.content-warning.accessibility.opened" = "Opened";
"status.delete" = "Delete"; "status.delete" = "Delete";
"status.delete.confirm.post" = "Are you sure you want to delete this post?"; "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?"; "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 { if !statusConfiguration.viewModel.shouldShowContent {
statusConfiguration.viewModel.toggleShowContent() statusConfiguration.viewModel.toggleShowContent()
UIAccessibility.post(notification: .screenChanged, argument: self)
return true return true
} else { } else {
return super.accessibilityActivate() return super.accessibilityActivate()

View File

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