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