I was wondering, how to create application supporting gestures. Suppose, that an activity contains an area with buttons, which can be switched to two other such areas. Switching can be performed with a swipe gesture - like switching desktops on main screen.

Let's look at the mater from following perspective. When user touches button, program doesn't yet know, what user wish to do. If user lifts the finger from screen, it shall be interpreted as a button click. On the other hand, if user moves the finger after touching, the program shall start the gesture recognition process.

I've put the button on GestureOverlayView and confirmed, that I was able to implement gesture events when swiping on the screen. However, the button was also responding to touch events and it looked like both views were handling them. I wish to protect myself against such behavior: when user moves finger on the screen, the button shall no longer react to touch events.