mirror of
https://github.com/bartgryszko/react-native-circular-progress.git
synced 2026-01-25 16:25:58 +00:00
More code style
This commit is contained in:
parent
327cce9a33
commit
07f332cbeb
@ -1,12 +1,6 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
Animated,
|
||||
AppState,
|
||||
Easing,
|
||||
View,
|
||||
ViewPropTypes
|
||||
} from 'react-native';
|
||||
import { Animated, AppState, Easing, View, ViewPropTypes } from 'react-native';
|
||||
import CircularProgress from './CircularProgress';
|
||||
const AnimatedProgress = Animated.createAnimatedComponent(CircularProgress);
|
||||
|
||||
@ -14,8 +8,8 @@ export default class AnimatedCircularProgress extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
fillAnimation: new Animated.Value(props.prefill)
|
||||
}
|
||||
fillAnimation: new Animated.Value(props.prefill),
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
@ -29,9 +23,12 @@ export default class AnimatedCircularProgress extends React.PureComponent {
|
||||
}
|
||||
|
||||
reAnimate(prefill, toVal, dur, ease) {
|
||||
this.setState({
|
||||
fillAnimation: new Animated.Value(prefill)
|
||||
}, () => this.animate(toVal, dur, ease));
|
||||
this.setState(
|
||||
{
|
||||
fillAnimation: new Animated.Value(prefill),
|
||||
},
|
||||
() => this.animate(toVal, dur, ease)
|
||||
);
|
||||
}
|
||||
|
||||
animate(toVal, dur, ease) {
|
||||
@ -52,12 +49,7 @@ export default class AnimatedCircularProgress extends React.PureComponent {
|
||||
render() {
|
||||
const { fill, prefill, ...other } = this.props;
|
||||
|
||||
return (
|
||||
<AnimatedProgress
|
||||
{...other}
|
||||
fill={this.state.fillAnimation}
|
||||
/>
|
||||
);
|
||||
return <AnimatedProgress {...other} fill={this.state.fillAnimation} />;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user