GestureDetector.SimpleOnGestureListener
public
static
class
GestureDetector.SimpleOnGestureListener
extends Object
implements
GestureDetector.OnGestureListener,
GestureDetector.OnDoubleTapListener,
GestureDetector.OnContextClickListener
| java.lang.Object | |
| ↳ | android.view.GestureDetector.SimpleOnGestureListener |
A convenience class to extend when you only want to listen for a subset
of all the gestures. This implements all methods in the
GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener, and GestureDetector.OnContextClickListener
but does nothing and return false for all applicable methods.
Summary
Public constructors | |
|---|---|
GestureDetector.SimpleOnGestureListener()
|
|
Public methods | |
|---|---|
boolean
|
onContextClick(MotionEvent e)
Notified when a context click occurs. |
boolean
|
onDoubleTap(MotionEvent e)
Notified when a double-tap occurs. |
boolean
|
onDoubleTapEvent(MotionEvent e)
Notified when an event within a double-tap gesture occurs, including the down, move, and up events. |
boolean
|
onDown(MotionEvent e)
Notified when a tap occurs with the down |
boolean
|
onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
Notified of a fling event when it occurs with the initial on down |
void
|
onLongPress(MotionEvent e)
Notified when a long press occurs with the initial on down |
boolean
|
onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
Notified when a scroll occurs with the initial on down |
void
|
onShowPress(MotionEvent e)
The user has performed a down |
boolean
|
onSingleTapConfirmed(MotionEvent e)
Notified when a single-tap occurs. |
boolean
|
onSingleTapUp(MotionEvent e)
Notified when a tap occurs with the up |
Inherited methods | |
|---|---|
java.lang.Object
| |
android.view.GestureDetector.OnGestureListener
| |
android.view.GestureDetector.OnDoubleTapListener
| |
android.view.GestureDetector.OnContextClickListener
| |
Public constructors
GestureDetector.SimpleOnGestureListener
GestureDetector.SimpleOnGestureListener ()
Public methods
onContextClick
boolean onContextClick (MotionEvent e)
Notified when a context click occurs.
| Parameters | |
|---|---|
e |
MotionEvent: The motion event that occurred during the context click. |
| Returns | |
|---|---|
boolean |
true if the event is consumed, else false |
onDoubleTap
boolean onDoubleTap (MotionEvent e)
Notified when a double-tap occurs.
| Parameters | |
|---|---|
e |
MotionEvent: The down motion event of the first tap of the double-tap. |
| Returns | |
|---|---|
boolean |
true if the event is consumed, else false |
onDoubleTapEvent
boolean onDoubleTapEvent (MotionEvent e)
Notified when an event within a double-tap gesture occurs, including the down, move, and up events.
| Parameters | |
|---|---|
e |
MotionEvent: The motion event that occurred during the double-tap gesture. |
| Returns | |
|---|---|
boolean |
true if the event is consumed, else false |
onDown
boolean onDown (MotionEvent e)
Notified when a tap occurs with the down MotionEvent
that triggered it. This will be triggered immediately for
every down event. All other events should be preceded by this.
| Parameters | |
|---|---|
e |
MotionEvent: The down motion event.
|
| Returns | |
|---|---|
boolean |
|
onFling
boolean onFling (MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
Notified of a fling event when it occurs with the initial on down MotionEvent
and the matching up MotionEvent. The calculated velocity is supplied along
the x and y axis in pixels per second.
| Parameters | |
|---|---|
e1 |
MotionEvent: The first down motion event that started the fling. |
e2 |
MotionEvent: The move motion event that triggered the current onFling. |
velocityX |
float: The velocity of this fling measured in pixels per second
along the x axis. |
velocityY |
float: The velocity of this fling measured in pixels per second
along the y axis. |
| Returns | |
|---|---|
boolean |
true if the event is consumed, else false |
onLongPress
void onLongPress (MotionEvent e)
Notified when a long press occurs with the initial on down MotionEvent
that trigged it.
| Parameters | |
|---|---|
e |
MotionEvent: The initial on down motion event that started the longpress.
|
onScroll
boolean onScroll (MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
Notified when a scroll occurs with the initial on down MotionEvent and the
current move MotionEvent. The distance in x and y is also supplied for
convenience.
| Parameters | |
|---|---|
e1 |
MotionEvent: The first down motion event that started the scrolling. |
e2 |
MotionEvent: The move motion event that triggered the current onScroll. |
distanceX |
float: The distance along the X axis that has been scrolled since the last
call to onScroll. This is NOT the distance between e1
and e2. |
distanceY |
float: The distance along the Y axis that has been scrolled since the last
call to onScroll. This is NOT the distance between e1
and e2. |
| Returns | |
|---|---|
boolean |
true if the event is consumed, else false |
onShowPress
void onShowPress (MotionEvent e)
The user has performed a down MotionEvent and not performed
a move or up yet. This event is commonly used to provide visual
feedback to the user to let them know that their action has been
recognized i.e. highlight an element.
| Parameters | |
|---|---|
e |
MotionEvent: The down motion event
|
onSingleTapConfirmed
boolean onSingleTapConfirmed (MotionEvent e)
Notified when a single-tap occurs.
Unlike onSingleTapUp(MotionEvent), this
will only be called after the detector is confident that the user's
first tap is not followed by a second tap leading to a double-tap
gesture.
| Parameters | |
|---|---|
e |
MotionEvent: The down motion event of the single-tap. |
| Returns | |
|---|---|
boolean |
true if the event is consumed, else false |
onSingleTapUp
boolean onSingleTapUp (MotionEvent e)
Notified when a tap occurs with the up MotionEvent
that triggered it.
| Parameters | |
|---|---|
e |
MotionEvent: The up motion event that completed the first tap |
| Returns | |
|---|---|
boolean |
true if the event is consumed, else false |
Annotations
Interfaces
- ActionMode.Callback
- ActionProvider.VisibilityListener
- Choreographer.FrameCallback
- CollapsibleActionView
- ContextMenu
- ContextMenu.ContextMenuInfo
- GestureDetector.OnContextClickListener
- GestureDetector.OnDoubleTapListener
- GestureDetector.OnGestureListener
- InputQueue.Callback
- KeyEvent.Callback
- LayoutInflater.Factory
- LayoutInflater.Factory2
- LayoutInflater.Filter
- Menu
- MenuItem
- MenuItem.OnActionExpandListener
- MenuItem.OnMenuItemClickListener
- PixelCopy.OnPixelCopyFinishedListener
- ScaleGestureDetector.OnScaleGestureListener
- SubMenu
- SurfaceHolder
- SurfaceHolder.Callback
- SurfaceHolder.Callback2
- TextureView.SurfaceTextureListener
- View.OnApplyWindowInsetsListener
- View.OnAttachStateChangeListener
- View.OnCapturedPointerListener
- View.OnClickListener
- View.OnContextClickListener
- View.OnCreateContextMenuListener
- View.OnDragListener
- View.OnFocusChangeListener
- View.OnGenericMotionListener
- View.OnHoverListener
- View.OnKeyListener
- View.OnLayoutChangeListener
- View.OnLongClickListener
- View.OnScrollChangeListener
- View.OnSystemUiVisibilityChangeListener
- View.OnTouchListener
- ViewGroup.OnHierarchyChangeListener
- ViewManager
- ViewParent
- ViewStub.OnInflateListener
- ViewTreeObserver.OnDrawListener
- ViewTreeObserver.OnGlobalFocusChangeListener
- ViewTreeObserver.OnGlobalLayoutListener
- ViewTreeObserver.OnPreDrawListener
- ViewTreeObserver.OnScrollChangedListener
- ViewTreeObserver.OnTouchModeChangeListener
- ViewTreeObserver.OnWindowAttachListener
- ViewTreeObserver.OnWindowFocusChangeListener
- Window.Callback
- Window.OnFrameMetricsAvailableListener
- Window.OnRestrictedCaptionAreaChangedListener
- WindowManager
Classes
- AbsSavedState
- ActionMode
- ActionMode.Callback2
- ActionProvider
- Choreographer
- ContextThemeWrapper
- Display
- Display.HdrCapabilities
- Display.Mode
- DragAndDropPermissions
- DragEvent
- FocusFinder
- FrameMetrics
- FrameStats
- GestureDetector
- GestureDetector.SimpleOnGestureListener
- Gravity
- HapticFeedbackConstants
- InputDevice
- InputDevice.MotionRange
- InputEvent
- InputQueue
- KeyboardShortcutGroup
- KeyboardShortcutInfo
- KeyCharacterMap
- KeyCharacterMap.KeyData
- KeyEvent
- KeyEvent.DispatcherState
- LayoutInflater
- MenuInflater
- MotionEvent
- MotionEvent.PointerCoords
- MotionEvent.PointerProperties
- OrientationEventListener
- OrientationListener
- PixelCopy
- PointerIcon
- ScaleGestureDetector
- ScaleGestureDetector.SimpleOnScaleGestureListener
- SearchEvent
- SoundEffectConstants
- Surface
- SurfaceView
- TextureView
- TouchDelegate
- VelocityTracker
- View
- View.AccessibilityDelegate
- View.BaseSavedState
- View.DragShadowBuilder
- View.MeasureSpec
- ViewAnimationUtils
- ViewConfiguration
- ViewDebug
- ViewGroup
- ViewGroup.LayoutParams
- ViewGroup.MarginLayoutParams
- ViewGroupOverlay
- ViewOutlineProvider
- ViewOverlay
- ViewPropertyAnimator
- ViewStructure
- ViewStructure.HtmlInfo
- ViewStructure.HtmlInfo.Builder
- ViewStub
- ViewTreeObserver
- Window
- WindowAnimationFrameStats
- WindowContentFrameStats
- WindowId
- WindowId.FocusObserver
- WindowInsets
- WindowManager.LayoutParams
Enums
Exceptions