should i override onDown() of GestureDetector.SimpleOnGestureListener?

602 views Asked by At

It seems that there are many questions about it, but many were that they can't get touchevent they wanted and solved by override onDown() with return true, from the developer document it says

it's best practice to implement an onDown() method that returns true. This is because all gestures begin with an onDown() message. If you return false from onDown(), as GestureDetector.SimpleOnGestureListener does by default, the system assumes that you want to ignore the rest of the gesture

but I didn't override the onDown() and I only override the onSingleTapUp(), I can detect the event I want, if it likes the doc says it should ignore it, so whether onDown() is necessary to override?

1

There are 1 answers

1
Mostafa Gazar On BEST ANSWER

Yes, onDown is supposed to return true if you want SimpleOnGestureListener to work, receive future touch events, in case of false

the other methods of GestureDetector.OnGestureListener never get called

If you do not want to return false you will have to implement your custom Detector