-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathMain.js
More file actions
36 lines (35 loc) · 913 Bytes
/
Copy pathMain.js
File metadata and controls
36 lines (35 loc) · 913 Bytes
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
import React, {Component} from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import AnimatedCircularProgress from './AnimatedCircularProgress';
export default class Main extends Component {
constructor(props) {
super(props);
this.state = {fill: 100};
}
render() {
return (
<View>
<AnimatedCircularProgress
size={200}
width={10}
fill={this.state.fill}
prefill={100}
tintColor="#8c1df4"
backgroundColor="#EEECF0"
linecap="round"
>
{
(fill) => (
<Text>
{ fill.toFixed(0) } %
</Text>
)
}
</AnimatedCircularProgress>
<TouchableOpacity onPress={() => this.setState({fill: this.state.fill - 20})}>
<Text>Touch</Text>
</TouchableOpacity>
</View>
);
}
}