-
Notifications
You must be signed in to change notification settings - Fork 0
/
32_activity_loader.js
57 lines (47 loc) · 1002 Bytes
/
32_activity_loader.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import React,{useEffect,useState} from 'react';
import { Button, Text, View,ActivityIndicator,StyleSheet } from 'react-native';
const App = () => {
const [loading,setLoading] = useState(false);
const displayLoader = () => {
setLoading(true);
setTimeout(() => {
setLoading(false);
}, 3000);
}
return (
<View style={styles.main}>
<ActivityIndicator size={100} color="red" animating={loading} />
<Button title="Show loader" onPress={displayLoader}/>
</View>
);
}
const styles = StyleSheet.create({
main:{
flex:1,
alignItems:'center',
justifyContent:'center',
},
radioText:{
fontSize:20,
},
radio:{
height:40,
width:40,
borderColor:'black',
borderWidth:2,
borderRadius:20,
margin:10,
},
radioWrapper:{
flexDirection:'row',
alignItems:'center',
},
radioBg:{
height:28,
width:28,
backgroundColor:'black',
borderRadius:14,
margin:4,
}
})
export default App;