mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 00:01:00 +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";
|
||||
"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 a new issue