Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch event #266

Open
voulgarakis opened this issue Jan 27, 2021 · 5 comments
Open

Touch event #266

voulgarakis opened this issue Jan 27, 2021 · 5 comments

Comments

@voulgarakis
Copy link

Hello,

Is it possible to change the progress fill by touching and moving the circle in the renderCap?

@sturmenta
Copy link

Are you planning to add this functionality in the future?

@voulgarakis
Copy link
Author

I did a custom implementation using PanResponder

@mohamad-1994
Copy link

I did a custom implementation using PanResponder

can you share it with me ?
I need change progress on touch

@voulgarakis
Copy link
Author

import {
...
PanResponder,
} from 'react-native';

const _circularProgressRef = React.createRef();
const _panResponder = PanResponder.create({
onStartShouldSetPanResponder: (evt, gestureState) => true,
onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
onMoveShouldSetPanResponder: (evt, gestureState) => true,
onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,

onPanResponderGrant: (evt, gestureState) => {
  setIsMoving(true);
  setPointsDelta(0);
},

onPanResponderMove: (evt, gestureState) => {
  if (_circularProgressRef.current) {
    _circularProgressRef.current.animate(0, 0);
  }

  // Handle state variable

},
onPanResponderTerminationRequest: (evt, gestureState) => true,
onPanResponderRelease: (evt, gestureState) => {
  if (_circularProgressRef.current) {
    _circularProgressRef.current.animate(100, 3000);
  }

  setIsMoving(false);
  setPointsDelta(0);
},

});

.
.
.

<View style={styles.progressBar} {..._panResponder.panHandlers}>
<AnimatedCircularProgress
duration={0}
size={300}
width={25}
fill={percentArc}
tintColor="#6277f1"
backgroundColor="#b1b1b1"
padding={10}
rotation={ROTATION}
arcSweepAngle={ARC}
renderCap={({center}) => (

)}>
...

@halesh71
Copy link

halesh71 commented Nov 8, 2021

is not working for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants