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
DOWN
case logic:In each of your swipe cases, you can then add this check:
And finally in your
UP
case, add:This will make it so that only swipes that are down for longer than
LONG_SWIPE_TIME
will be handled by your swipe code. For example, for theRIGHT
case, you will have: