|
| 1 | +import * as React from 'react'; |
| 2 | +import { StyleSheet, View, Text, ScrollView, TextInput } from 'react-native'; |
| 3 | + |
| 4 | +export function AccessibilityScreen() { |
| 5 | + return ( |
| 6 | + <ScrollView style={styles.container}> |
| 7 | + <View style={styles.view}> |
| 8 | + <Text accessible={false}>{'<View />'}</Text> |
| 9 | + </View> |
| 10 | + <View accessible style={styles.view}> |
| 11 | + <Text accessible={false}>{'<View accessible />'}</Text> |
| 12 | + </View> |
| 13 | + <View role="button" style={styles.view}> |
| 14 | + <Text accessible={false}>{'<View role="button" />'}</Text> |
| 15 | + </View> |
| 16 | + <View accessible role="button" style={styles.view}> |
| 17 | + <Text accessible={false}>{'<View accessible role="button" />'}</Text> |
| 18 | + </View> |
| 19 | + <View accessible role="slider" style={styles.view}> |
| 20 | + <Text accessible={false}>{'<View accessible role="slider" />'}</Text> |
| 21 | + </View> |
| 22 | + <View accessible role="none" style={styles.view}> |
| 23 | + <Text accessible={false}>{'<View accessible role="none" />'}</Text> |
| 24 | + </View> |
| 25 | + |
| 26 | + <Text style={styles.text}>{'<Text />'}</Text> |
| 27 | + <Text accessible={false} style={styles.text}> |
| 28 | + {'<Text accessible={false} />'} |
| 29 | + </Text> |
| 30 | + <Text role="none" style={styles.text}> |
| 31 | + {'<Text role="none" />'} |
| 32 | + </Text> |
| 33 | + |
| 34 | + <TextInput style={styles.textInput} value="<TextInput />" /> |
| 35 | + <TextInput |
| 36 | + editable={false} |
| 37 | + style={styles.textInput} |
| 38 | + value="<TextInput editable={false} />" |
| 39 | + /> |
| 40 | + <TextInput |
| 41 | + accessibilityRole="search" |
| 42 | + style={styles.textInput} |
| 43 | + value="<TextInput accessibilityRole='search' />" |
| 44 | + /> |
| 45 | + <TextInput |
| 46 | + role="searchbox" |
| 47 | + style={styles.textInput} |
| 48 | + value="<TextInput role='search' />" |
| 49 | + /> |
| 50 | + <TextInput |
| 51 | + role="none" |
| 52 | + style={styles.textInput} |
| 53 | + value="<TextInput role='none' />" |
| 54 | + /> |
| 55 | + <TextInput |
| 56 | + accessible={false} |
| 57 | + style={styles.textInput} |
| 58 | + value="<TextInput accessible={false} />" |
| 59 | + /> |
| 60 | + </ScrollView> |
| 61 | + ); |
| 62 | +} |
| 63 | + |
| 64 | +const styles = StyleSheet.create({ |
| 65 | + container: { |
| 66 | + flex: 1, |
| 67 | + }, |
| 68 | + view: { |
| 69 | + padding: 20, |
| 70 | + backgroundColor: 'grey', |
| 71 | + }, |
| 72 | + text: { |
| 73 | + padding: 20, |
| 74 | + backgroundColor: '#b1f2ff', |
| 75 | + }, |
| 76 | + textInput: { |
| 77 | + padding: 20, |
| 78 | + backgroundColor: '#fbebd8', |
| 79 | + }, |
| 80 | +}); |
0 commit comments