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

can we have while_swipingLeft/while_swipingRight or onSwipe method with direction values #69

Open
BJSam opened this issue Aug 16, 2020 · 3 comments

Comments

@BJSam
Copy link

BJSam commented Aug 16, 2020

i want to get dy dx values or vx vy values when card is started to swipe

@BJSam BJSam changed the title can we have while_swipingLeft/while_ or onSwipe method can we have while_swipingLeft/while_ or onSwipe method with driection values Aug 16, 2020
@BJSam BJSam changed the title can we have while_swipingLeft/while_ or onSwipe method with driection values can we have while_swipingLeft/while_swipingRight or onSwipe method with driection values Aug 16, 2020
@BJSam BJSam changed the title can we have while_swipingLeft/while_swipingRight or onSwipe method with driection values can we have while_swipingLeft/while_swipingRight or onSwipe method with direction values Aug 16, 2020
@lhandel
Copy link
Owner

lhandel commented Aug 16, 2020

There are a CardStack events called onSwipe where you receive the current x, and y coordinates.

@BJSam
Copy link
Author

BJSam commented Aug 16, 2020

There are a CardStack events called onSwipe where you receive the current x, and y coordinates.

oh! my bad i did not check. thank you.

can you help me to do some animation?

like when card is started moving left increase opacity of a view and if card is swiped make opacity 0 and if card is still or moved back to initial state then also opacity should be 0

@BJSam
Copy link
Author

BJSam commented Aug 16, 2020

and one more

how to make this work?

const RenderCards=()=>{
 const myLoop =[];
  for(var i = 0; i < dataa.length; i++) {
   console.log(dataa[i].cardName);
   myLoop.push(
    <Card style={[styles.card]}><Text onPress={()=>{clickedCard(dataa[i])}} style={styles.label}>{dataa[i].cardName}</Text></Card>
   );
  
}
return myLoop;
}

and in render()

 <CardStack
        style={styles.content}
        renderNoMoreCards={() => <Text style={{ fontWeight: '700', fontSize: 18, color: 'gray' }}>No more cards :(</Text>}
        ref={swiper => {
          this.swiper = swiper
        }}
        onSwiped={() => console.log('onSwiped')}
        onSwipedLeft={() => console.log('onSwipedLeft')}
        onSwipe={(x,y)=>console.log(x+"||||||||||||||"+y)}
      >
   
   
        {RenderCards()}
      </CardStack>

please help

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

2 participants