public class

GestureDetector

extends Object
java.lang.Object
   ↳ com.facebook.drawee.gestures.GestureDetector

Class Overview

Gesture detector based on touch events.

This class allows us to get click events when we need them, but not to consume them when we are temporarily not interested in them. Doing View.setClickable(true) will cause for the view always to consume click event, even if View.performClick is overridden to return false. That means even though our view didn't handle the click event, the event will not get propagated upwards. Result of View.onTouchEvent is handled correctly though so we use that instead.

This class currently only detects clicks.

Summary

Nested Classes
interface GestureDetector.ClickListener Interface for the click listener. 
Public Constructors
GestureDetector(Context context)
Public Methods
void init()
Initializes this component to its initial state.
boolean isCapturingGesture()
Returns whether the gesture capturing is in progress.
static GestureDetector newInstance(Context context)
Creates a new instance of this gesture detector.
boolean onTouchEvent(MotionEvent event)
Handles the touch event
void reset()
Resets component.
void setClickListener(GestureDetector.ClickListener clickListener)
Sets the click listener.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public GestureDetector (Context context)

Public Methods

public void init ()

Initializes this component to its initial state.

public boolean isCapturingGesture ()

Returns whether the gesture capturing is in progress.

public static GestureDetector newInstance (Context context)

Creates a new instance of this gesture detector.

public boolean onTouchEvent (MotionEvent event)

Handles the touch event

public void reset ()

Resets component.

This will drop any gesture recognition that might currently be in progress.

public void setClickListener (GestureDetector.ClickListener clickListener)

Sets the click listener.