-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInfinite.js
93 lines (87 loc) · 1.73 KB
/
Infinite.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import React, { Component } from "react";
import {
Text,
View,
StyleSheet,
Animated,
TouchableOpacity
} from "react-native";
export default class Infinite extends Component {
state = {
rotateValue: new Animated.Value(0)
};
componentDidMount() {
this._start();
}
_start = () => {
Animated.loop(
Animated.timing(this.state.rotateValue, {
toValue: 1,
duration: 400,
Infinite: true
})
).start();
};
render() {
return (
<View style={styles.container}>
<Animated.View
style={{
transform: [
{
rotate: this.state.rotateValue.interpolate({
inputRange: [0, 1],
outputRange: ["0deg", "380deg"]
})
}
],
height: 50,
width: 50,
margin: 5,
borderWidth: 2,
borderColor: "#888",
borderBottomColor: "#8bffff",
borderRadius: 50,
justifyContent: "center"
}}
/>
<Text style={styles.text}>Fade </Text>
<Animated.View />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#FFF",
alignItems: "center",
justifyContent: "center"
},
item: {},
btn: {
backgroundColor: "#480032",
width: 100,
height: 40,
padding: 3,
justifyContent: "center",
borderRadius: 6
},
text: {
fontSize: 20,
color: "#fff",
fontWeight: "bold",
textAlign: "center"
},
item1: {
backgroundColor: "red",
padding: 20,
width: 100,
margin: 10
},
textBtn: {
color: "#f4f4f4",
fontWeight: "bold",
textAlign: "center"
}
});