From 860d2d2012ca9f7d1c6af53435e4b2af74478165 Mon Sep 17 00:00:00 2001 From: Ziqi Chen Date: Wed, 8 Aug 2018 01:20:44 -0700 Subject: [PATCH] Added 5 examples of new Accessibility API to RN Tester on Android Summary: I added three examples to the RN Tester in order to test the new accessibility props I've added to the accessibility API. These examples test the following properties on views and touchables: * AccessibilityRole * AccessibilityStates * AccessibilityHint Reviewed By: PeteTheHeat Differential Revision: D9167874 fbshipit-source-id: 4971b9ae43ad4f35c6be7e8548cc31393c3f0a33 --- .../js/AccessibilityAndroidExample.android.js | 64 ++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/RNTester/js/AccessibilityAndroidExample.android.js b/RNTester/js/AccessibilityAndroidExample.android.js index 23e0fa40c2c..cc52876963c 100644 --- a/RNTester/js/AccessibilityAndroidExample.android.js +++ b/RNTester/js/AccessibilityAndroidExample.android.js @@ -114,7 +114,7 @@ class AccessibilityAndroidExample extends React.Component { - + ToastAndroid.show('Toasts work by default', ToastAndroid.SHORT) @@ -127,6 +127,68 @@ class AccessibilityAndroidExample extends React.Component { + + + ToastAndroid.show('Toasts work by default', ToastAndroid.SHORT) + } + accessibilityRole="button" + accessibilityStates={['disabled']} + disabled={true}> + + I am disabled + Clicking me will not trigger any action. + + + + + + + ToastAndroid.show('Toasts work by default', ToastAndroid.SHORT) + } + accessibilityRole="button" + accessibilityHint="Triggers + Toasts"> + + Click Me! + + + + + + + Accessible view with hint, role, and state + + Talkback will say: accessibility hint button, selected{' '} + + + + + + + Accessible view with label, hint, role, and state + + Talkback will say: accessibility label, hint button, selected{' '} + + + + + + + This accessible view has no label, so the text is read. + + +