Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacse committed Jun 25, 2018
1 parent 805c34e commit 2474fdb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 86 deletions.
9 changes: 5 additions & 4 deletions example/App.js
Expand Up @@ -24,13 +24,13 @@ export default class Example extends React.Component {
},

onPanResponderMove: (evt, gestureState) => {
this.refs.circularProgress.performLinearAnimation(0, 0);
this.refs.circularProgress.animate(0, 0);
// For each 2 pixels add or subtract 1 point
this.setState({ pointsDelta: Math.round(-gestureState.dy / 2) });
},
onPanResponderTerminationRequest: (evt, gestureState) => true,
onPanResponderRelease: (evt, gestureState) => {
this.refs.circularProgress.performLinearAnimation(100, 2000);
this.refs.circularProgress.animate(100, 2000);
let points = this.state.points + this.state.pointsDelta;
console.log(Math.min(points, MAX_POINTS));
this.setState({
Expand All @@ -55,12 +55,13 @@ export default class Example extends React.Component {
fill={fill}
tintColor="#00e0ff"
backgroundColor="#3d5875"
renderChild={(fill) => (
>
{(fill) => (
<Text style={styles.points}>
{ Math.round(MAX_POINTS * fill / 100) }
</Text>
)}
/>
</AnimatedCircularProgress>

<AnimatedCircularProgress
size={120}
Expand Down
79 changes: 4 additions & 75 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/package.json
Expand Up @@ -22,6 +22,6 @@
"expo": "^27.0.0",
"react": "16.3.1",
"react-native": "^0.55.0",
"react-native-circular-progress": "file:../"
"react-native-circular-progress": "git+https://github.com/bgryszko/react-native-circular-progress.git"
}
}
2 changes: 1 addition & 1 deletion src/AnimatedCircularProgress.js
Expand Up @@ -62,6 +62,6 @@ AnimatedCircularProgress.propTypes = {

AnimatedCircularProgress.defaultProps = {
duration: 500,
easing: Easing.ease,
easing: Easing.elastic(1),
prefill: 0,
};
7 changes: 2 additions & 5 deletions src/CircularProgress.js
Expand Up @@ -83,7 +83,7 @@ export default class CircularProgress extends React.PureComponent {
</Svg>
{children && (
<View style={childContainerStyle}>
{typeof children === 'function' ? children(fill) : children}
{children(fill)}
</View>
)}
</View>
Expand All @@ -102,10 +102,7 @@ CircularProgress.propTypes = {
rotation: PropTypes.number,
lineCap: PropTypes.string,
arcSweepAngle: PropTypes.number,
children: PropTypes.oneOf([
propTypes.func,
PropTypes.node,
]),
children: PropTypes.func,
};

CircularProgress.defaultProps = {
Expand Down

0 comments on commit 2474fdb

Please sign in to comment.