1import * as React from 'react'; 2import { DrawerLayoutAndroid, StyleSheet, Text, View } from 'react-native'; 3 4import TitleSwitch from '../components/TitledSwitch'; 5 6export default function DrawerLayoutAndroidScreen() { 7 const [isRight, setRight] = React.useState(false); 8 9 const renderNavigationView = () => ( 10 <View 11 style={{ 12 flex: 1, 13 backgroundColor: '#fff', 14 alignItems: 'center', 15 justifyContent: 'center', 16 }}> 17 <Text>DrawerLayoutAndroid</Text> 18 </View> 19 ); 20 21 return ( 22 <DrawerLayoutAndroid 23 drawerWidth={300} 24 // @ts-ignore 25 drawerPosition={isRight ? 'right' : 'left'} 26 renderNavigationView={renderNavigationView}> 27 <View style={{ flex: 1, padding: 16 }}> 28 <TitleSwitch title="Is Right" value={isRight} setValue={setRight} /> 29 <Text>Pull from the {isRight ? 'right' : 'left'}</Text> 30 </View> 31 </DrawerLayoutAndroid> 32 ); 33} 34 35DrawerLayoutAndroidScreen.navigationOptions = { 36 title: 'DrawerLayoutAndroid', 37}; 38 39const styles = StyleSheet.create({ 40 scrollView: { 41 backgroundColor: '#eeeeee', 42 height: 300, 43 flex: 1, 44 maxHeight: 300, 45 }, 46 text: { 47 fontSize: 16, 48 fontWeight: 'bold', 49 paddingVertical: 8, 50 }, 51 item: { 52 margin: 5, 53 padding: 8, 54 backgroundColor: '#cccccc', 55 borderRadius: 3, 56 minWidth: 96, 57 maxHeight: 96, 58 }, 59}); 60