Profile Directory screen VoiceOver improvements

Add label to filter button (and change icon to match other filters)

Make each profile a single accessibility element
This commit is contained in:
Shadowfacts 2022-12-06 21:54:17 -05:00
parent 57668886b2
commit 60767c6a7e
2 changed files with 23 additions and 3 deletions

View File

@ -122,5 +122,24 @@ class FeaturedProfileCollectionViewCell: UICollectionViewCell {
displayNameLabel.updateForAccountDisplayName(account: account)
}
}
// MARK: Accessibility
override var isAccessibilityElement: Bool {
get { true }
set {}
}
override var accessibilityAttributedLabel: NSAttributedString? {
get {
guard let account else {
return nil
}
let s = NSMutableAttributedString(string: "\(account.displayName), ")
s.append(noteTextView.attributedText)
return s
}
set {}
}
}

View File

@ -34,8 +34,9 @@ class ProfileDirectoryViewController: UIViewController {
title = NSLocalizedString("Profile Directory", comment: "profile directory title")
// todo: it would be nice if there were a better "filter" icon
navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIImage(systemName: "scope"), menu: nil)
let filterItem = UIBarButtonItem(image: UIImage(systemName: "line.3.horizontal.decrease.circle"), menu: nil)
filterItem.accessibilityLabel = "Filter"
navigationItem.rightBarButtonItem = filterItem
updateFilterMenu()
let layout = UICollectionViewCompositionalLayout(sectionProvider: { (sectionIndex, layoutEnvironment) in