mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 00:01:00 +00:00
Improve profile VoiceOver
This commit is contained in:
parent
3b7152b7e3
commit
11e27d20d9
2 changed files with 15 additions and 0 deletions
|
@ -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";
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue