|
1 |
| -'use strict'; |
2 |
| -import React, { |
3 |
| - AppRegistry, |
4 |
| - Component, |
5 |
| - StyleSheet, |
6 |
| - Text, |
7 |
| - View, |
8 |
| - Image |
9 |
| -} from 'react-native'; |
| 1 | +"use strict"; |
10 | 2 |
|
11 |
| -import SettingsList from 'react-native-settings-list'; |
| 3 | +import React, { |
| 4 | + AppRegistry, |
| 5 | + Component, |
| 6 | + StyleSheet, |
| 7 | + Text, |
| 8 | + View, |
| 9 | + Image, |
| 10 | +} from "react-native"; |
12 | 11 |
|
| 12 | +import SettingsList from "react-native-settings-list"; |
13 | 13 |
|
14 | 14 | class SettingsListExample extends Component {
|
15 |
| - constructor(){ |
16 |
| - super(); |
17 |
| - } |
18 |
| - render() { |
19 |
| - return ( |
20 |
| - <View style={{backgroundColor:'#f6f6f6',flex:1}}> |
21 |
| - <View style={{borderBottomWidth:1, backgroundColor:'#263238',borderColor:'#c8c7cc'}}> |
22 |
| - <Text style={{color:'white',marginTop:15,marginBottom:15, marginLeft:15,fontWeight:'bold',fontSize:20}}>Settings</Text> |
23 |
| - </View> |
24 |
| - <View style={{backgroundColor:'#f6f6f6',flex:1}}> |
25 |
| - <SettingsList borderColor='#d6d5d9' defaultItemSize={50}> |
26 |
| - <SettingsList.Item |
27 |
| - hasNavArrow={false} |
28 |
| - title='Wireless & networks' |
29 |
| - titleStyle={{color:'#009688', marginBottom:10, fontWeight:'500'}} |
30 |
| - itemWidth={50} |
31 |
| - borderHide={'Both'} |
32 |
| - /> |
33 |
| - <SettingsList.Item |
34 |
| - icon={ |
35 |
| - <View style={styles.imageStyle}> |
36 |
| - <Image style={{alignSelf:'center',height:22, width:22}} source={require('./images/data.png')}/> |
37 |
| - </View> |
38 |
| - } |
39 |
| - hasNavArrow={false} |
40 |
| - itemWidth={70} |
41 |
| - titleStyle={{color:'black', fontSize: 16}} |
42 |
| - title='Data usage' |
43 |
| - /> |
44 |
| - <SettingsList.Item |
45 |
| - icon={ |
46 |
| - <View style={styles.imageStyle}> |
47 |
| - <Image style={{alignSelf:'center',height:4, width:18}} source={require('./images/more.png')}/> |
48 |
| - </View> |
49 |
| - } |
50 |
| - title='More' |
51 |
| - itemWidth={70} |
52 |
| - titleStyle={{color:'black', fontSize: 16}} |
53 |
| - hasNavArrow={false} |
54 |
| - /> |
55 |
| - <SettingsList.Header headerStyle={{marginTop:-5}}/> |
56 |
| - <SettingsList.Item |
57 |
| - hasNavArrow={false} |
58 |
| - title='Device' |
59 |
| - titleStyle={{color:'#009688', marginBottom:10, fontWeight:'bold'}} |
60 |
| - itemWidth={70} |
61 |
| - borderHide={'Both'} |
62 |
| - /> |
63 |
| - <SettingsList.Item |
64 |
| - icon={ |
65 |
| - <View style={styles.imageStyle}> |
66 |
| - <Image style={{alignSelf:'center',height:22, width:22}} source={require('./images/display2.png')}/> |
67 |
| - </View> |
68 |
| - } |
69 |
| - title='Display' |
70 |
| - itemWidth={70} |
71 |
| - titleStyle={{color:'black', fontSize: 16}} |
72 |
| - hasNavArrow={false} |
73 |
| - /> |
74 |
| - <SettingsList.Item |
75 |
| - icon={ |
76 |
| - <View style={styles.imageStyle}> |
77 |
| - <Image style={{alignSelf:'center',height:20, width:18}} source={require('./images/sound.png')}/> |
78 |
| - </View> |
79 |
| - } |
80 |
| - title='Sound & notification' |
81 |
| - itemWidth={70} |
82 |
| - titleStyle={{color:'black', fontSize: 16}} |
83 |
| - hasNavArrow={false} |
84 |
| - /> |
85 |
| - <SettingsList.Item |
86 |
| - icon={ |
87 |
| - <View style={styles.imageStyle}> |
88 |
| - <Image style={{alignSelf:'center',height:22, width:14}} source={require('./images/apps.png')}/> |
89 |
| - </View> |
90 |
| - } |
91 |
| - title='Apps' |
92 |
| - itemWidth={70} |
93 |
| - titleStyle={{color:'black', fontSize: 16}} |
94 |
| - hasNavArrow={false} |
95 |
| - /> |
96 |
| - <SettingsList.Item |
97 |
| - icon={ |
98 |
| - <View style={styles.imageStyle}> |
99 |
| - <Image style={{alignSelf:'center',height:14, width:20}} source={require('./images/storage.png')}/> |
100 |
| - </View> |
101 |
| - } |
102 |
| - title='Storage & USB' |
103 |
| - itemWidth={70} |
104 |
| - titleStyle={{color:'black', fontSize: 16}} |
105 |
| - hasNavArrow={false} |
106 |
| - /> |
107 |
| - <SettingsList.Item |
108 |
| - icon={ |
109 |
| - <View style={styles.imageStyle}> |
110 |
| - <Image style={{alignSelf:'center',height:22, width:14}} source={require('./images/battery.png')}/> |
111 |
| - </View> |
112 |
| - } |
113 |
| - title='Battery' |
114 |
| - itemWidth={70} |
115 |
| - titleStyle={{color:'black', fontSize: 16}} |
116 |
| - hasNavArrow={false} |
117 |
| - /> |
118 |
| - <SettingsList.Item |
119 |
| - icon={ |
120 |
| - <View style={styles.imageStyle}> |
121 |
| - <Image style={{alignSelf:'center',height:18, width:20}} source={require('./images/memory.png')}/> |
122 |
| - </View> |
123 |
| - } |
124 |
| - title='Memory' |
125 |
| - itemWidth={70} |
126 |
| - titleStyle={{color:'black', fontSize: 16}} |
127 |
| - hasNavArrow={false} |
128 |
| - /> |
129 |
| - <SettingsList.Header headerStyle={{marginTop: -5}}/> |
130 |
| - </SettingsList> |
131 |
| - </View> |
132 |
| - </View> |
133 |
| - ); |
134 |
| - } |
| 15 | + constructor() { |
| 16 | + super(); |
| 17 | + } |
| 18 | + render() { |
| 19 | + return ( |
| 20 | + <View style={{ backgroundColor: "#f6f6f6", flex: 1 }}> |
| 21 | + <View |
| 22 | + style={{ |
| 23 | + borderBottomWidth: 1, |
| 24 | + backgroundColor: "#263238", |
| 25 | + borderColor: "#c8c7cc", |
| 26 | + }} |
| 27 | + > |
| 28 | + <Text |
| 29 | + style={{ |
| 30 | + color: "white", |
| 31 | + marginTop: 15, |
| 32 | + marginBottom: 15, |
| 33 | + marginLeft: 15, |
| 34 | + fontWeight: "bold", |
| 35 | + fontSize: 20, |
| 36 | + }} |
| 37 | + > |
| 38 | + Settings |
| 39 | + </Text> |
| 40 | + </View> |
| 41 | + <View style={{ backgroundColor: "#f6f6f6", flex: 1 }}> |
| 42 | + <SettingsList borderColor="#d6d5d9" defaultItemSize={50}> |
| 43 | + <SettingsList.Item |
| 44 | + hasNavArrow={false} |
| 45 | + title="Wireless & networks" |
| 46 | + titleStyle={{ |
| 47 | + color: "#009688", |
| 48 | + marginBottom: 10, |
| 49 | + fontWeight: "500", |
| 50 | + }} |
| 51 | + itemWidth={50} |
| 52 | + borderHide={"Both"} |
| 53 | + /> |
| 54 | + <SettingsList.Item |
| 55 | + icon={ |
| 56 | + <View style={styles.imageStyle}> |
| 57 | + <Image |
| 58 | + style={{ alignSelf: "center", height: 22, width: 22 }} |
| 59 | + source={require("./images/data.png")} |
| 60 | + /> |
| 61 | + </View> |
| 62 | + } |
| 63 | + hasNavArrow={false} |
| 64 | + itemWidth={70} |
| 65 | + titleStyle={{ color: "black", fontSize: 16 }} |
| 66 | + title="Data usage" |
| 67 | + /> |
| 68 | + <SettingsList.Item |
| 69 | + icon={ |
| 70 | + <View style={styles.imageStyle}> |
| 71 | + <Image |
| 72 | + style={{ alignSelf: "center", height: 4, width: 18 }} |
| 73 | + source={require("./images/more.png")} |
| 74 | + /> |
| 75 | + </View> |
| 76 | + } |
| 77 | + title="More" |
| 78 | + itemWidth={70} |
| 79 | + titleStyle={{ color: "black", fontSize: 16 }} |
| 80 | + hasNavArrow={false} |
| 81 | + /> |
| 82 | + <SettingsList.Header headerStyle={{ marginTop: -5 }} /> |
| 83 | + <SettingsList.Item |
| 84 | + hasNavArrow={false} |
| 85 | + title="Device" |
| 86 | + titleStyle={{ |
| 87 | + color: "#009688", |
| 88 | + marginBottom: 10, |
| 89 | + fontWeight: "bold", |
| 90 | + }} |
| 91 | + itemWidth={70} |
| 92 | + borderHide={"Both"} |
| 93 | + /> |
| 94 | + <SettingsList.Item |
| 95 | + icon={ |
| 96 | + <View style={styles.imageStyle}> |
| 97 | + <Image |
| 98 | + style={{ alignSelf: "center", height: 22, width: 22 }} |
| 99 | + source={require("./images/display2.png")} |
| 100 | + /> |
| 101 | + </View> |
| 102 | + } |
| 103 | + title="Display" |
| 104 | + itemWidth={70} |
| 105 | + titleStyle={{ color: "black", fontSize: 16 }} |
| 106 | + hasNavArrow={false} |
| 107 | + /> |
| 108 | + <SettingsList.Item |
| 109 | + icon={ |
| 110 | + <View style={styles.imageStyle}> |
| 111 | + <Image |
| 112 | + style={{ alignSelf: "center", height: 20, width: 18 }} |
| 113 | + source={require("./images/sound.png")} |
| 114 | + /> |
| 115 | + </View> |
| 116 | + } |
| 117 | + title="Sound & notification" |
| 118 | + itemWidth={70} |
| 119 | + titleStyle={{ color: "black", fontSize: 16 }} |
| 120 | + hasNavArrow={false} |
| 121 | + /> |
| 122 | + <SettingsList.Item |
| 123 | + icon={ |
| 124 | + <View style={styles.imageStyle}> |
| 125 | + <Image |
| 126 | + style={{ alignSelf: "center", height: 22, width: 14 }} |
| 127 | + source={require("./images/apps.png")} |
| 128 | + /> |
| 129 | + </View> |
| 130 | + } |
| 131 | + title="Apps" |
| 132 | + itemWidth={70} |
| 133 | + titleStyle={{ color: "black", fontSize: 16 }} |
| 134 | + hasNavArrow={false} |
| 135 | + /> |
| 136 | + <SettingsList.Item |
| 137 | + icon={ |
| 138 | + <View style={styles.imageStyle}> |
| 139 | + <Image |
| 140 | + style={{ alignSelf: "center", height: 14, width: 20 }} |
| 141 | + source={require("./images/storage.png")} |
| 142 | + /> |
| 143 | + </View> |
| 144 | + } |
| 145 | + title="Storage & USB" |
| 146 | + itemWidth={70} |
| 147 | + titleStyle={{ color: "black", fontSize: 16 }} |
| 148 | + hasNavArrow={false} |
| 149 | + /> |
| 150 | + <SettingsList.Item |
| 151 | + icon={ |
| 152 | + <View style={styles.imageStyle}> |
| 153 | + <Image |
| 154 | + style={{ alignSelf: "center", height: 22, width: 14 }} |
| 155 | + source={require("./images/battery.png")} |
| 156 | + /> |
| 157 | + </View> |
| 158 | + } |
| 159 | + title="Battery" |
| 160 | + itemWidth={70} |
| 161 | + titleStyle={{ color: "black", fontSize: 16 }} |
| 162 | + hasNavArrow={false} |
| 163 | + /> |
| 164 | + <SettingsList.Item |
| 165 | + icon={ |
| 166 | + <View style={styles.imageStyle}> |
| 167 | + <Image |
| 168 | + style={{ alignSelf: "center", height: 18, width: 20 }} |
| 169 | + source={require("./images/memory.png")} |
| 170 | + /> |
| 171 | + </View> |
| 172 | + } |
| 173 | + title="Memory" |
| 174 | + itemWidth={70} |
| 175 | + titleStyle={{ color: "black", fontSize: 16 }} |
| 176 | + hasNavArrow={false} |
| 177 | + /> |
| 178 | + <SettingsList.Header headerStyle={{ marginTop: -5 }} /> |
| 179 | + </SettingsList> |
| 180 | + </View> |
| 181 | + </View> |
| 182 | + ); |
| 183 | + } |
135 | 184 | }
|
136 | 185 |
|
137 | 186 | const styles = StyleSheet.create({
|
138 |
| - imageStyle:{ |
139 |
| - marginLeft:15, |
140 |
| - marginRight:20, |
141 |
| - alignSelf:'center', |
142 |
| - width:20, |
143 |
| - height:24, |
144 |
| - justifyContent:'center' |
145 |
| - } |
| 187 | + imageStyle: { |
| 188 | + marginLeft: 15, |
| 189 | + marginRight: 20, |
| 190 | + alignSelf: "center", |
| 191 | + width: 20, |
| 192 | + height: 24, |
| 193 | + justifyContent: "center", |
| 194 | + }, |
146 | 195 | });
|
147 | 196 |
|
148 |
| -AppRegistry.registerComponent('SettingsListExample', () => SettingsListExample); |
| 197 | +AppRegistry.registerComponent("SettingsListExample", () => SettingsListExample); |
0 commit comments