-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
44 lines (40 loc) · 912 Bytes
/
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
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
View,
Animated,
Easing
} from 'react-native';
import LottieView from 'lottie-react-native';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
progress: new Animated.Value(0),
};
}
componentDidMount() {
Animated.sequence([
Animated.timing(this.state.progress, {
toValue: 1,
duration: 1000,
easing: Easing.linear,
}),
Animated.timing(this.state.progress, {
toValue: 0,
duration: 0
})
]).start(this.componentDidMount.bind(this));
}
render() {
return (
<View style={{flex: 1}}>
<LottieView source={require('./animations/bounching_ball.json')} progress={this.state.progress} />
</View>
);
}
}