I am using the droidQuery library to handle swipe events using the method
$.with(myView).swipe(new Function(...));
(see my previous post here), and I was wondering if their is a way to expand upon the answer in order to check how long the user is swiping, and react differently based on how long the down-time is. Thanks for any answers!
You can follow the model discussed here, with some additional code in the swipe logic. From off the linked code, we have the following switch statement:
To add a check for the down time, add the following class variables:
Then add this to the
DOWNcase logic:In each of your swipe cases, you can then add this check:
And finally in your
UPcase, add:This will make it so that only swipes that are down for longer than
LONG_SWIPE_TIMEwill be handled by your swipe code. For example, for theRIGHTcase, you will have: