Accessibility wip
This commit is contained in:
parent
783a44a67e
commit
550a1acb8b
|
@ -80,6 +80,7 @@
|
|||
"compose-button.accessibility-label.toot" = "Compose Toot";
|
||||
"emoji.custom" = "Custom";
|
||||
"emoji.default-skin-tone" = "Default skin tone";
|
||||
"emoji.default-skin-tone-button.accessibility-label" = "Select default skin tone";
|
||||
"emoji.frequently-used" = "Frequently used";
|
||||
"emoji.search" = "Search Emoji";
|
||||
"emoji.system-group.smileys-and-emotion" = "Smileys & Emotion";
|
||||
|
|
|
@ -130,12 +130,16 @@ final class EmojiPickerViewController: UIViewController {
|
|||
for: .normal)
|
||||
skinToneButton.showsMenuAsPrimaryAction = true
|
||||
skinToneButton.menu = defaultSkinToneSelectionMenu
|
||||
skinToneButton.accessibilityLabel =
|
||||
NSLocalizedString("emoji.default-skin-tone-button.accessibility-label", comment: "")
|
||||
|
||||
view.addSubview(collectionView)
|
||||
collectionView.translatesAutoresizingMaskIntoConstraints = false
|
||||
collectionView.backgroundColor = .clear
|
||||
collectionView.dataSource = dataSource
|
||||
collectionView.delegate = self
|
||||
collectionView.isAccessibilityElement = false
|
||||
collectionView.shouldGroupAccessibilityChildren = true
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
searchBar.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
||||
|
|
|
@ -64,6 +64,8 @@ private extension EmojiView {
|
|||
emojiLabel.trailingAnchor.constraint(equalTo: layoutMarginsGuide.trailingAnchor),
|
||||
emojiLabel.bottomAnchor.constraint(equalTo: layoutMarginsGuide.bottomAnchor)
|
||||
])
|
||||
|
||||
setupAccessibility()
|
||||
}
|
||||
|
||||
func applyEmojiConfiguration() {
|
||||
|
@ -74,11 +76,17 @@ private extension EmojiView {
|
|||
emojiLabel.isHidden = true
|
||||
|
||||
imageView.kf.setImage(with: emoji.url)
|
||||
accessibilityLabel = emoji.shortcode
|
||||
} else {
|
||||
imageView.isHidden = true
|
||||
emojiLabel.isHidden = false
|
||||
|
||||
emojiLabel.text = emojiConfiguration.emoji.name
|
||||
accessibilityLabel = emojiConfiguration.emoji.name
|
||||
}
|
||||
}
|
||||
|
||||
func setupAccessibility() {
|
||||
isAccessibilityElement = true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue