react-native-card-stack-swiper icon indicating copy to clipboard operation
react-native-card-stack-swiper copied to clipboard

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

Open BJSam opened this issue 4 years ago • 3 comments

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

BJSam avatar Aug 16 '20 15:08 BJSam

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

lhandel avatar Aug 16 '20 15:08 lhandel

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 avatar Aug 16 '20 16:08 BJSam

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

BJSam avatar Aug 16 '20 16:08 BJSam