-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathActivityIndicatorExample.tsx
More file actions
65 lines (54 loc) · 1.53 KB
/
ActivityIndicatorExample.tsx
File metadata and controls
65 lines (54 loc) · 1.53 KB
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
58
59
60
61
62
63
64
65
import * as React from 'react';
import { StyleSheet, View } from 'react-native';
import { ActivityIndicator, FAB, List, Colors } from 'react-native-paper';
import ScreenWrapper from '../ScreenWrapper';
const ActivityIndicatorExample = () => {
const [animating, setAnimating] = React.useState<boolean>(true);
return (
<ScreenWrapper style={styles.container}>
<View style={styles.row}>
<FAB
size="small"
icon={animating ? 'pause' : 'play'}
onPress={() => setAnimating(!animating)}
/>
</View>
<List.Section title="Default">
<ActivityIndicator animating={animating} hidesWhenStopped={false} />
</List.Section>
<List.Section title="Large">
<ActivityIndicator
animating={animating}
size="large"
hidesWhenStopped={false}
/>
</List.Section>
<List.Section title="Custom size">
<ActivityIndicator
animating={animating}
size={100}
hidesWhenStopped={false}
/>
</List.Section>
<List.Section title="Custom color">
<ActivityIndicator
animating={animating}
color={Colors.error20}
hidesWhenStopped={false}
/>
</List.Section>
</ScreenWrapper>
);
};
ActivityIndicatorExample.title = 'Activity Indicator';
const styles = StyleSheet.create({
container: {
padding: 4,
},
row: {
justifyContent: 'center',
alignItems: 'center',
margin: 10,
},
});
export default ActivityIndicatorExample;