MCPcopy
hub / github.com/oblador/react-native-progress / animate

Method animate

CircleSnail.js:72–98  ·  view source on GitHub ↗
(iteration = 1)

Source from the content-addressed store, hash-verified

70 }
71
72 animate(iteration = 1) {
73 Animated.sequence([
74 Animated.timing(this.state.startAngle, {
75 toValue: -MAX_ARC_ANGLE * iteration - MIN_ARC_ANGLE,
76 duration: this.props.duration || 1000,
77 isInteraction: false,
78 easing: Easing.inOut(Easing.quad),
79 useNativeDriver: this.props.useNativeDriver,
80 }),
81 Animated.timing(this.state.endAngle, {
82 toValue: -MAX_ARC_ANGLE * iteration,
83 duration: this.props.duration || 1000,
84 isInteraction: false,
85 easing: Easing.inOut(Easing.quad),
86 useNativeDriver: this.props.useNativeDriver,
87 }),
88 ]).start(endState => {
89 if (endState.finished) {
90 if (Array.isArray(this.props.color)) {
91 this.setState({
92 colorIndex: iteration % this.props.color.length,
93 });
94 }
95 this.animate(iteration + 1);
96 }
97 });
98 }
99
100 spin() {
101 Animated.timing(this.state.rotation, {

Callers 2

componentDidMountMethod · 0.95
componentDidUpdateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected