java.lang.Object | |
↳ | com.facebook.drawee.gestures.GestureDetector |
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.
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
|
Initializes this component to its initial state.
Returns whether the gesture capturing is in progress.
Creates a new instance of this gesture detector.
Handles the touch event
Resets component.
This will drop any gesture recognition that might currently be in progress.