android.view
public
class
android.view.GestureDetector
Detects various gestures and events using the supplied MotionEvents.
The GestureDetector.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:
Nested Classes
Summary
Public Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
Creates a GestureDetector with the supplied listener.
This variant of the constructor should be used from a non-UI thread
(as it allows specifying the Handler).
Parameters
listener
| the listener invoked for all the callbacks, this must
not be null. |
handler
| the handler to use, this must
not be null. |
Creates a GestureDetector with the supplied listener.
You may only use this constructor from a UI thread (this is the usual situation).
Parameters
listener
| the listener invoked for all the callbacks, this must
not be null. |
Public Methods
public
boolean
isLongpressEnabled()
Returns
- true if longpress is enabled, else false.
public
void
setIsLongpressEnabled(boolean isLongpressEnabled)
Set whether longpress is enabled, if this is enabled when a user
presses and holds down you get a longpress event and nothing further.
If it's disabled the user can press and hold down and then later
moved their finger and you will get scroll events. By default
longpress is enabled.
Parameters
isLongpressEnabled
| whether longpress should be enabled.
|