mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Localize "search", "button", and "togglebutton" accessibility roles by using the platform roles
Summary: Several accessibilityRole strings are hardcoded to only English on Android. Swap them to just use the platform constants. This way, TalkBack will handle translations. This change swaps roles "search", "button", and "togglebutton" roles to use the platform description. Changelog: [Android][Changed] Localize "search", "button", and "togglebutton" accessibility roles by using the platform roles Reviewed By: lunaleaps Differential Revision: D28077246 fbshipit-source-id: 5b88a6fd7e78b3426506f253b823ecca0608c4bc
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5d01110b53
commit
399285f91c
-4
@@ -385,18 +385,14 @@ public class ReactAccessibilityDelegate extends AccessibilityDelegateCompat {
|
||||
spannable.setSpan(new URLSpan(""), 0, spannable.length(), 0);
|
||||
nodeInfo.setText(spannable);
|
||||
}
|
||||
} else if (role.equals(AccessibilityRole.SEARCH)) {
|
||||
nodeInfo.setRoleDescription(context.getString(R.string.search_description));
|
||||
} else if (role.equals(AccessibilityRole.IMAGE)) {
|
||||
nodeInfo.setRoleDescription(context.getString(R.string.image_description));
|
||||
} else if (role.equals(AccessibilityRole.IMAGEBUTTON)) {
|
||||
nodeInfo.setRoleDescription(context.getString(R.string.imagebutton_description));
|
||||
nodeInfo.setClickable(true);
|
||||
} else if (role.equals(AccessibilityRole.BUTTON)) {
|
||||
nodeInfo.setRoleDescription(context.getString(R.string.button_description));
|
||||
nodeInfo.setClickable(true);
|
||||
} else if (role.equals(AccessibilityRole.TOGGLEBUTTON)) {
|
||||
nodeInfo.setRoleDescription(context.getString(R.string.toggle_button_description));
|
||||
nodeInfo.setClickable(true);
|
||||
nodeInfo.setCheckable(true);
|
||||
} else if (role.equals(AccessibilityRole.SUMMARY)) {
|
||||
|
||||
Reference in New Issue
Block a user