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

Is it possible to get the which cardFace is active? #24

Open
nzsambo opened this issue Apr 18, 2022 · 4 comments
Open

Is it possible to get the which cardFace is active? #24

nzsambo opened this issue Apr 18, 2022 · 4 comments

Comments

@nzsambo
Copy link

nzsambo commented Apr 18, 2022

Thanks for this library!

How can I retrieve which card face is showing so that I can default to the 'front' on focus?

Thanks!

@JungHsuan
Copy link
Owner

It's not possible for now, but I can add this functionality.

@anniewey
Copy link

anniewey commented Nov 7, 2024

@JungHsuan any chance to release this functionality?

Meanwhile I'm creating my own patch as below, but not sure if i update it correctly. I'm passing the index 1 or 0 based on the faces to onFlipEnd callback.

diff --git a/node_modules/react-native-gesture-flip-card/gestureFlipView.js b/node_modules/react-native-gesture-flip-card/gestureFlipView.js
index fb80bb2..03391d4 100644
--- a/node_modules/react-native-gesture-flip-card/gestureFlipView.js
+++ b/node_modules/react-native-gesture-flip-card/gestureFlipView.js
@@ -137,7 +137,7 @@ const GestureFlipView = React.forwardRef((props, ref) => {
     }).start(() => {
       isAnimating.current = false;
       flippedValue.current = null;
-      props.onFlipEnd && props.onFlipEnd();
+      props.onFlipEnd && props.onFlipEnd(cardFaceRef.current? 1 : 0);
     });
   }
 
@@ -166,7 +166,7 @@ const GestureFlipView = React.forwardRef((props, ref) => {
     }).start(() => {
       isAnimating.current = false;
       flippedValue.current = null;
-      props.onFlipEnd && props.onFlipEnd();
+      props.onFlipEnd && props.onFlipEnd(cardFaceRef.current? 1 : 0);
     });
   }

@JungHsuan
Copy link
Owner

@JungHsuan any chance to release this functionality?

Meanwhile I'm creating my own patch as below, but not sure if i update it correctly. I'm passing the index 1 or 0 based on the faces to onFlipEnd callback.

diff --git a/node_modules/react-native-gesture-flip-card/gestureFlipView.js b/node_modules/react-native-gesture-flip-card/gestureFlipView.js
index fb80bb2..03391d4 100644
--- a/node_modules/react-native-gesture-flip-card/gestureFlipView.js
+++ b/node_modules/react-native-gesture-flip-card/gestureFlipView.js
@@ -137,7 +137,7 @@ const GestureFlipView = React.forwardRef((props, ref) => {
     }).start(() => {
       isAnimating.current = false;
       flippedValue.current = null;
-      props.onFlipEnd && props.onFlipEnd();
+      props.onFlipEnd && props.onFlipEnd(cardFaceRef.current? 1 : 0);
     });
   }
 
@@ -166,7 +166,7 @@ const GestureFlipView = React.forwardRef((props, ref) => {
     }).start(() => {
       isAnimating.current = false;
       flippedValue.current = null;
-      props.onFlipEnd && props.onFlipEnd();
+      props.onFlipEnd && props.onFlipEnd(cardFaceRef.current? 1 : 0);
     });
   }

Yes, I think so. Sorry for keeping you waiting, I will work on it soon!

@JungHsuan
Copy link
Owner

@nzsambo @anniewey The version 1.1.0 is published! Please see the README for more information!

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

3 participants