mirror of
https://github.com/bartgryszko/react-native-circular-progress.git
synced 2026-01-18 16:13:10 +00:00
Fixes
This commit is contained in:
parent
805c34efcd
commit
2474fdbd7c
@ -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({
|
||||
@ -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}
|
||||
|
||||
79
example/package-lock.json
generated
79
example/package-lock.json
generated
@ -9131,93 +9131,22 @@
|
||||
"integrity": "sha1-IWevhrvJ+WS9Rb1fN2hOW1SWXjI="
|
||||
},
|
||||
"react-native-circular-progress": {
|
||||
"version": "file:..",
|
||||
"version": "git+https://github.com/bgryszko/react-native-circular-progress.git#805c34efcdfe150a5290d8f12d00fdc0424bf290",
|
||||
"from": "git+https://github.com/bgryszko/react-native-circular-progress.git",
|
||||
"requires": {
|
||||
"prop-types": "^15.6.0",
|
||||
"react-native-svg": "^6.3.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"color": {
|
||||
"version": "2.0.1",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"color-convert": "^1.9.1",
|
||||
"color-string": "^1.5.2"
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
"version": "1.9.2",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"color-name": "1.1.1"
|
||||
}
|
||||
},
|
||||
"color-name": {
|
||||
"version": "1.1.1",
|
||||
"bundled": true
|
||||
},
|
||||
"color-string": {
|
||||
"version": "1.5.2",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"color-name": "^1.0.0",
|
||||
"simple-swizzle": "^0.2.2"
|
||||
}
|
||||
},
|
||||
"fbjs": {
|
||||
"version": "",
|
||||
"bundled": true
|
||||
},
|
||||
"is-arrayish": {
|
||||
"version": "0.3.2",
|
||||
"bundled": true
|
||||
},
|
||||
"js-tokens": {
|
||||
"version": "3.0.2",
|
||||
"bundled": true
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.10",
|
||||
"bundled": true
|
||||
},
|
||||
"loose-envify": {
|
||||
"version": "1.3.1",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"js-tokens": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
"bundled": true
|
||||
},
|
||||
"pegjs": {
|
||||
"version": "0.10.0",
|
||||
"bundled": true
|
||||
},
|
||||
"prop-types": {
|
||||
"version": "15.6.2",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"loose-envify": "^1.3.1",
|
||||
"object-assign": "^4.1.1"
|
||||
}
|
||||
},
|
||||
"react-native-svg": {
|
||||
"version": "6.3.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-6.3.1.tgz",
|
||||
"integrity": "sha512-0kmfUwKUBWnPuJpy+bdGIYKkXHg/M/X57ji8b3d3ZFB2rRTWMRkwI1D+AJ6FQRX109+FJn6L6hsIokDj1lckzA==",
|
||||
"requires": {
|
||||
"color": "^2.0.1",
|
||||
"lodash": "^4.16.6",
|
||||
"pegjs": "^0.10.0"
|
||||
}
|
||||
},
|
||||
"simple-swizzle": {
|
||||
"version": "0.2.2",
|
||||
"bundled": true,
|
||||
"requires": {
|
||||
"is-arrayish": "^0.3.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,6 +62,6 @@ AnimatedCircularProgress.propTypes = {
|
||||
|
||||
AnimatedCircularProgress.defaultProps = {
|
||||
duration: 500,
|
||||
easing: Easing.ease,
|
||||
easing: Easing.elastic(1),
|
||||
prefill: 0,
|
||||
};
|
||||
|
||||
@ -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>
|
||||
@ -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 = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user