-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
69 lines (65 loc) · 1.85 KB
/
App.tsx
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
66
67
68
69
import * as React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { MaterialCircularProgressIndicator } from 'react-native-skia-ui/material-circular-progress-indicator';
import { useSharedValue, withTiming } from 'react-native-reanimated';
import { CupertinoActivityIndicator } from 'react-native-skia-ui/cupertino-activity-indicator';
export default function App() {
const progress = useSharedValue(0);
React.useEffect(() => {
const id = setInterval(() => {
progress.value = withTiming(Math.random(), { duration: 1000 });
}, 1000);
return () => clearInterval(id);
});
return (
<View style={styles.container}>
<Text>Determinate progress indicators</Text>
<MaterialCircularProgressIndicator.Determinate
size={56}
valueColor="green"
strokeWidth={5}
strokeCap="round"
value={progress}
/>
<MaterialCircularProgressIndicator.Determinate
size={100}
valueColor="blue"
strokeWidth={4}
strokeCap="round"
value={progress}
/>
<CupertinoActivityIndicator.PartiallyRevealed
color="black"
progress={progress}
radius={50}
/>
<Text>Indeterminate progress indicators</Text>
<MaterialCircularProgressIndicator.Indeterminate
size={40}
valueColor="black"
/>
<MaterialCircularProgressIndicator.Indeterminate
size={100}
valueColor="red"
backgroundColor={'#f0f0f0'}
strokeWidth={8}
strokeCap="round"
/>
<CupertinoActivityIndicator color="black" radius={50} />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
gap: 20,
justifyContent: 'center',
},
box: {
width: 60,
height: 60,
backgroundColor: 'blue',
marginVertical: 20,
},
});