Back to Fresco

GestureDetector

docs/javadoc/reference/com/facebook/drawee/gestures/GestureDetector.html

3.6.012.8 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Packages | Classes

Summary: Nested Classes | Ctors | Methods | Inherited Methods | [Expand All]

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
Public Constructors
Public Methods
void
Initializes this component to its initial state.
boolean
Returns whether the gesture capturing is in progress.
static GestureDetector
Creates a new instance of this gesture detector.
boolean
Handles the touch event
void
Resets component.
void
Sets the click listener.

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

|

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.

+Generated by Doclava. +