GestureDetector


public class GestureDetector
extends Object

java.lang.Object
   ↳ android.view.GestureDetector


Detects various gestures and events using the supplied MotionEvents. The OnGestureListener callback will notify users when a particular motion event has occurred. This class should only be used with MotionEvents reported via touch (don't use for trackball events). To use this class:

Summary

Nested classes

interface GestureDetector.OnContextClickListener

The listener that is used to notify when a context click occurs. 

interface GestureDetector.OnDoubleTapListener

The listener that is used to notify when a double-tap or a confirmed single-tap occur. 

interface GestureDetector.OnGestureListener

The listener that is used to notify when gestures occur. 

class GestureDetector.SimpleOnGestureListener

A convenience class to extend when you only want to listen for a subset of all the gestures. 

Public constructors

GestureDetector(Context context, GestureDetector.OnGestureListener listener)

Creates a GestureDetector with the supplied listener.

GestureDetector(Context context, GestureDetector.OnGestureListener listener, Handler handler)

Creates a GestureDetector with the supplied listener that runs deferred events on the thread associated with the supplied Handler.

GestureDetector(Context context, GestureDetector.OnGestureListener listener, Handler handler, boolean unused)

Creates a GestureDetector with the supplied listener that runs deferred events on the thread associated with the supplied Handler.

GestureDetector(GestureDetector.OnGestureListener listener)

This constructor is deprecated. Use GestureDetector(Context,GestureDetector.OnGestureListener) instead.

GestureDetector(GestureDetector.OnGestureListener listener, Handler handler)

This constructor is deprecated. Use GestureDetector(Context,GestureDetector.OnGestureListener,Handler) instead.

Public methods

boolean isLongpressEnabled()
boolean onGenericMotionEvent(