Add a “Show Original” accessibility action to statuses when relevant

This commit is contained in:
Jed Fox 2023-02-06 21:39:22 -05:00
parent ab7166017b
commit 97f5132977
No known key found for this signature in database
GPG Key ID: 0B61D18EA54B47E1
1 changed files with 9 additions and 0 deletions

View File

@ -628,10 +628,19 @@ extension StatusView {
get { get {
(contentMetaText.textView.accessibilityCustomActions ?? []) (contentMetaText.textView.accessibilityCustomActions ?? [])
+ toolbarActions + toolbarActions
+ (hideTranslationAction.map { [$0] } ?? [])
+ (authorView.accessibilityCustomActions ?? []) + (authorView.accessibilityCustomActions ?? [])
} }
set { } set { }
} }
private var hideTranslationAction: UIAccessibilityCustomAction? {
guard viewModel.translatedFromLanguage != nil else { return nil }
return UIAccessibilityCustomAction(name: L10n.Common.Controls.Status.Translation.showOriginal) { [weak self] _ in
self?.revertTranslation()
return true
}
}
} }
// MARK: - AdaptiveContainerView // MARK: - AdaptiveContainerView