diff --git a/Localizations/Localizable.strings b/Localizations/Localizable.strings index 9f852ed..47b2909 100644 --- a/Localizations/Localizable.strings +++ b/Localizations/Localizable.strings @@ -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?"; diff --git a/Views/UIKit/Content Views/StatusView.swift b/Views/UIKit/Content Views/StatusView.swift index e769da8..51ad769 100644 --- a/Views/UIKit/Content Views/StatusView.swift +++ b/Views/UIKit/Content Views/StatusView.swift @@ -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() diff --git a/Views/UIKit/StatusBodyView.swift b/Views/UIKit/StatusBodyView.swift index bc34dd3..e8f1726 100644 --- a/Views/UIKit/StatusBodyView.swift +++ b/Views/UIKit/StatusBodyView.swift @@ -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.append(mutableContent) - } else { - accessibilityAttributedLabel.appendWithSeparator(mutableContent) - } + accessibilityAttributedLabel.appendWithSeparator(mutableSpoilerText) + } else if !contentTextView.isHidden { + accessibilityAttributedLabel.append(mutableContent) } for view in [attachmentsView, pollView, cardView] where !view.isHidden {