Improve profile VoiceOver

This commit is contained in:
Justin Mazzocchi 2021-02-03 15:00:32 -08:00
parent 3b7152b7e3
commit 11e27d20d9
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
2 changed files with 15 additions and 0 deletions

View File

@ -21,6 +21,7 @@
"account.follows-you" = "Follows you"; "account.follows-you" = "Follows you";
"account.header.accessibility-label-%@" = "Header image: %@"; "account.header.accessibility-label-%@" = "Header image: %@";
"account.hide-reblogs" = "Hide boosts"; "account.hide-reblogs" = "Hide boosts";
"account.locked.accessibility-label" = "Locked account";
"account.mute" = "Mute"; "account.mute" = "Mute";
"account.reject-follow-request-button.accessibility-label" = "Reject follow request"; "account.reject-follow-request-button.accessibility-label" = "Reject follow request";
"account.request" = "Request"; "account.request" = "Request";

View File

@ -75,6 +75,19 @@ final class AccountHeaderView: UIView {
accountLabel.text = accountViewModel.accountName accountLabel.text = accountViewModel.accountName
lockedImageView.isHidden = !accountViewModel.isLocked lockedImageView.isHidden = !accountViewModel.isLocked
var accountStackViewAccessibilityLabel = accountViewModel.accountName
if !lockedImageView.isHidden {
accountStackViewAccessibilityLabel
.appendWithSeparator(NSLocalizedString("account.locked.accessibility-label", comment: ""))
}
if !followsYouLabel.isHidden, let followsYouText = followsYouLabel.text {
accountStackViewAccessibilityLabel.appendWithSeparator(followsYouText)
}
accountStackView.accessibilityLabel = accountStackViewAccessibilityLabel
for view in fieldsStackView.arrangedSubviews { for view in fieldsStackView.arrangedSubviews {
fieldsStackView.removeArrangedSubview(view) fieldsStackView.removeArrangedSubview(view)
view.removeFromSuperview() view.removeFromSuperview()
@ -276,6 +289,7 @@ private extension AccountHeaderView {
baseStackView.addArrangedSubview(accountStackView) baseStackView.addArrangedSubview(accountStackView)
accountStackView.spacing = .compactSpacing accountStackView.spacing = .compactSpacing
accountStackView.isAccessibilityElement = true
accountStackView.addArrangedSubview(accountLabel) accountStackView.addArrangedSubview(accountLabel)
accountLabel.numberOfLines = 0 accountLabel.numberOfLines = 0