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

Question: Transferring an in progress gesture #94

Closed
nixterrimus opened this issue Jan 5, 2018 · 2 comments
Closed

Question: Transferring an in progress gesture #94

nixterrimus opened this issue Jan 5, 2018 · 2 comments

Comments

@nixterrimus
Copy link

nixterrimus commented Jan 5, 2018

Hello!

I'm working on a keypad that has multiples pages, buttons that press, buttons that long press and bring up a popover and popovers that you can pan between options. Wheh! Here's what I've got so far:

gesture-in-progress

I think I need to transfer the long press gesture to the pan gesture so that I can select items in the submenu. Is there any way to do this? Things are kind of working by using simultaneousHandlers on the pan gesture handler but that eats up the paging gesture. What I really want to say to the pan gesture handler- Wait until the long press is fired and then when the finger moves begin to recognize.

@nixterrimus
Copy link
Author

nixterrimus commented Jan 5, 2018

Here's a link to the movie for slightly better fidelity: https://imgur.com/a/QE0Ht
Here's sketch-quality code: https://gist.github.com/nixterrimus/b6cc926031636ef8cbd2b20044baef37

@kmagiera
Copy link
Member

kmagiera commented Jan 6, 2018

Thanks @nixterrimus for reaching out.

I'm not sure I fully understand your usecase but let me try to answer regardless:

So I think what you may want to try is just having the LongPressHandler to implement button along with the submenu. You should be able to use onHandlerStateChange event to determine when long press occurs and show submenu and also have onGestureEvent callback registered to be able to get pointer (finger) position while long press is happening. Also you should set shouldCancelWhenOutside={false} as you don't want longpress handler to cancel when you swipe away from the button while panning over the submenu. Please note that you will be getting raw gesture events (via onGestureEvent callback) only when the state of the handler is ACTIVE.

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