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.header.accessibility-label-%@" = "Header image: %@";
"account.hide-reblogs" = "Hide boosts";
"account.locked.accessibility-label" = "Locked account";
"account.mute" = "Mute";
"account.reject-follow-request-button.accessibility-label" = "Reject follow request";
"account.request" = "Request";

View file

@ -75,6 +75,19 @@ final class AccountHeaderView: UIView {
accountLabel.text = accountViewModel.accountName
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 {
fieldsStackView.removeArrangedSubview(view)
view.removeFromSuperview()
@ -276,6 +289,7 @@ private extension AccountHeaderView {
baseStackView.addArrangedSubview(accountStackView)
accountStackView.spacing = .compactSpacing
accountStackView.isAccessibilityElement = true
accountStackView.addArrangedSubview(accountLabel)
accountLabel.numberOfLines = 0