This repository has been archived by the owner on Jun 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 438
[WIP] [NEW] Project 08 - Adding Reactions VoiceOver accessible #2746
Open
rudrankriyam
wants to merge
5
commits into
RocketChat:develop
Choose a base branch
from
rudrankriyam:project08-Addingreactions
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a450410
Adding reactions
rudrankriyam 6548a61
add currentSkinTone
rudrankriyam 3607d2b
emojiLabel accessibility header
rudrankriyam 7dd9041
custom emoji double swipe fix
rudrankriyam 46d200c
changeSkinTone button accessibility improvements
rudrankriyam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,13 +93,13 @@ final class EmojiPicker: UIView, RCEmojiKitLocalizable { | |
|
||
@IBOutlet weak var emojisCollectionView: UICollectionView! | ||
|
||
let skinTones: [(name: String?, color: UIColor)] = [ | ||
(name: nil, color: #colorLiteral(red: 0.999120295, green: 0.8114234805, blue: 0.06628075987, alpha: 1)), | ||
(name: "tone1", color: #colorLiteral(red: 0.982526958, green: 0.8808286786, blue: 0.7670835853, alpha: 1)), | ||
(name: "tone2", color: #colorLiteral(red: 0.8934452534, green: 0.7645885944, blue: 0.6247871518, alpha: 1)), | ||
(name: "tone3", color: #colorLiteral(red: 0.7776196599, green: 0.6034522057, blue: 0.4516467452, alpha: 1)), | ||
(name: "tone4", color: #colorLiteral(red: 0.6469842792, green: 0.4368215203, blue: 0.272474587, alpha: 1)), | ||
(name: "tone5", color: #colorLiteral(red: 0.391161263, green: 0.3079459369, blue: 0.2550256848, alpha: 1)) | ||
let skinTones: [(name: String?, color: UIColor, accessibilityName: String)] = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Large Tuple Violation: Tuples should have at most 2 members. (large_tuple) |
||
(name: nil, color: #colorLiteral(red: 0.999120295, green: 0.8114234805, blue: 0.06628075987, alpha: 1), "skinTone.default"), | ||
(name: "tone1", color: #colorLiteral(red: 0.982526958, green: 0.8808286786, blue: 0.7670835853, alpha: 1), "skinTone.tone1"), | ||
(name: "tone2", color: #colorLiteral(red: 0.8934452534, green: 0.7645885944, blue: 0.6247871518, alpha: 1), "skinTone.tone2"), | ||
(name: "tone3", color: #colorLiteral(red: 0.7776196599, green: 0.6034522057, blue: 0.4516467452, alpha: 1), "skinTone.tone3"), | ||
(name: "tone4", color: #colorLiteral(red: 0.6469842792, green: 0.4368215203, blue: 0.272474587, alpha: 1), "skinTone.tone4"), | ||
(name: "tone5", color: #colorLiteral(red: 0.391161263, green: 0.3079459369, blue: 0.2550256848, alpha: 1), "skinTone.tone5") | ||
] | ||
|
||
var currentSkinToneIndex: Int { | ||
|
@@ -112,7 +112,7 @@ final class EmojiPicker: UIView, RCEmojiKitLocalizable { | |
} | ||
} | ||
|
||
var currentSkinTone: (name: String?, color: UIColor) { | ||
var currentSkinTone: (name: String?, color: UIColor, accessibilityName: String) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Large Tuple Violation: Tuples should have at most 2 members. (large_tuple) |
||
return skinTones[currentSkinToneIndex] | ||
} | ||
|
||
|
@@ -121,13 +121,17 @@ final class EmojiPicker: UIView, RCEmojiKitLocalizable { | |
skinToneButton.layer.cornerRadius = skinToneButton.frame.width/2 | ||
skinToneButton.backgroundColor = currentSkinTone.color | ||
skinToneButton.showsTouchWhenHighlighted = true | ||
skinToneButton.accessibilityLabel = | ||
localized("skinTone.label") + localized("currentSkinTone.label") | ||
skinToneButton.accessibilityValue = localized(currentSkinTone.accessibilityName) | ||
} | ||
} | ||
|
||
@IBAction func didPressSkinToneButton(_ sender: UIButton) { | ||
currentSkinToneIndex += 1 | ||
currentSkinToneIndex = currentSkinToneIndex % skinTones.count | ||
skinToneButton.backgroundColor = currentSkinTone.color | ||
skinToneButton.accessibilityValue = localized(currentSkinTone.accessibilityName) | ||
emojisCollectionView.reloadData() | ||
} | ||
|
||
|
@@ -180,6 +184,8 @@ final class EmojiPicker: UIView, RCEmojiKitLocalizable { | |
let categoryItems = currentCategories.map { category -> UITabBarItem in | ||
let image = UIImage(named: category.name) ?? UIImage(named: "custom") | ||
let item = UITabBarItem(title: nil, image: image, selectedImage: image) | ||
item.isAccessibilityElement = true | ||
item.accessibilityLabel = category.name | ||
item.imageInsets = UIEdgeInsets(top: 6, left: 0, bottom: -6, right: 0) | ||
return item | ||
} | ||
|
@@ -215,6 +221,7 @@ extension EmojiPicker: UICollectionViewDataSource { | |
) as? EmojiPickerSectionHeaderView else { return UICollectionReusableView() } | ||
|
||
headerView.textLabel.text = localized("categories.\(currentCategories[indexPath.section].name)") | ||
headerView.textLabel.accessibilityTraits = .header | ||
|
||
return headerView | ||
} | ||
|
@@ -230,6 +237,8 @@ extension EmojiPicker: UICollectionViewDataSource { | |
|
||
if let file = emoji.imageUrl { | ||
cell.emoji = .custom(URL(string: file)) | ||
cell.emojiImageView.accessibilityLabel = emoji.name | ||
cell.emojiImageView.accessibilityTraits = .staticText | ||
} else { | ||
var toneModifier = "" | ||
if emoji.supportsTones, let currentTone = currentSkinTone.name { toneModifier = "_\(currentTone)" } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would wanna undo these changes in the .standard case. Because, the cells are reusable and later when the same cell is populated with a standard emoji, it'll be skipped by voiceover.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch. I forgot this. I will fix this.