mirror of
https://github.com/status-im/react-native.git
synced 2025-01-15 12:05:06 +00:00
added image button role on android
Summary: Because we're now separating accessibilityTraits into accessibilityRole and accessibilityState, we're going to only allow one role to be set, and allow on preset combinations of roles that make sense. This adds android functionality for an added role that is image button. Reviewed By: blavalla Differential Revision: D8846987 fbshipit-source-id: 9fe36828f63b05bd2c9cf9680204b1995d678342
This commit is contained in:
parent
5acb7211bb
commit
5741f77156
@ -34,6 +34,7 @@ public class AccessibilityRoleUtil {
|
||||
LINK("android.widget.Button"),
|
||||
SEARCH("android.widget.EditText"),
|
||||
IMAGE("android.widget.ImageView"),
|
||||
IMAGEBUTTON("android.widget.ImageView"),
|
||||
KEYBOARDKEY("android.inputmethodservice.Keyboard$Key"),
|
||||
TEXT("android.widget.ViewGroup"),
|
||||
ADJUSTABLE("android.widget.SeekBar");
|
||||
@ -91,6 +92,10 @@ public class AccessibilityRoleUtil {
|
||||
if (role.equals(AccessibilityRole.IMAGE)) {
|
||||
nodeInfo.setRoleDescription("Image");
|
||||
}
|
||||
if (role.equals(AccessibilityRole.IMAGEBUTTON)) {
|
||||
nodeInfo.setRoleDescription("Button Image");
|
||||
nodeInfo.setClickable(true);
|
||||
}
|
||||
if (role.equals(AccessibilityRole.ADJUSTABLE)) {
|
||||
nodeInfo.setRoleDescription("Adjustable");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user