-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
60 lines (55 loc) · 1.24 KB
/
App.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
58
59
60
import React, { Component } from 'react';
import { StyleSheet, View, Button } from 'react-native';
import ProgressBar from './src/components/ProgressBar';
export default class Progressable extends Component {
static navigationOptions = {
title: 'ProgressBar Example',
};
state = {
progress: 0,
visible: true,
};
componentDidMount() {
let progress = 0;
this.timeout = setInterval(() => {
this.setState(
{
progress: progress.toFixed(1),
},
() => {
progress = progress + 0.1;
//progress = progress;
if (progress > 1) {
clearInterval(this.timeout);
}
},
);
}, 1500);
}
render() {
return (
<View style={styles.container}>
{this.state.visible && (
<ProgressBar
progress={this.state.progress}
style={{
margin: 20,
borderColor: 'black',
borderWidth: 2,
borderRadius: 50,
}}
/>
)}
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
borderRadius: 50,
},
});