public class

MapOnTouchListener

extends Object
implements View.OnTouchListener MapGestureDetector.OnGestureListener
java.lang.Object
   ↳ com.esri.android.map.MapOnTouchListener

Class Overview

An interface definition for a callback to be invoked when a touch event is dispatched to a MapView. The callback will be invoked before the touch event is given to the MapView.

Summary

Fields
public static int PINCH_ZOOM_TOLERANECE_INDEGREE The PINC h_ zoo m_ toleranec e_ indegree.
public static int SENSITIVITY_TOLERANCE_INPIXEL The SENSITIVIT y_ toleranc e_ inpixel.
Public Constructors
MapOnTouchListener(Context context, MapView view)
Instantiates an object of MapOnTouchListener with the activity context and the MapView.
Public Methods
boolean onDoubleTap(MotionEvent point)
Notified when a single-pointer-double-tap gesture occurs.
boolean onDragPointerMove(MotionEvent from, MotionEvent to)
Notified when a part of a single touch drag gesture event occurs.
boolean onDragPointerUp(MotionEvent from, MotionEvent to)
Notified when a part of a single-touch-drag gesture event occurs.
void onLongPress(MotionEvent point)
Notified when a long-press gesture occurs.
void onMultiPointersSingleTap(MotionEvent event)
Notified when a two-pointers-single-tap gesture occurs.
boolean onPinchPointersDown(MotionEvent event)
Notified when a part of a pinch gesture occurs.
boolean onPinchPointersMove(MotionEvent event)
Notified when a part of a pinch gesture occurs.
boolean onPinchPointersUp(MotionEvent event)
Notified when a part of a pinch gesture occurs.
boolean onSingleTap(MotionEvent point)
Notified when a single-pointer-single-tap gesture occurs.
boolean onTouch(View v, MotionEvent event)
Called when a touch event is dispatched to a view.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.view.View.OnTouchListener
From interface com.esri.android.map.MapGestureDetector.OnGestureListener

Fields

public static int PINCH_ZOOM_TOLERANECE_INDEGREE

The PINC h_ zoo m_ toleranec e_ indegree.

public static int SENSITIVITY_TOLERANCE_INPIXEL

The SENSITIVIT y_ toleranc e_ inpixel.

Public Constructors

public MapOnTouchListener (Context context, MapView view)

Instantiates an object of MapOnTouchListener with the activity context and the MapView.

Parameters
context the activity context.
view the MapView that will be dispatching the events.

Public Methods

public boolean onDoubleTap (MotionEvent point)

Notified when a single-pointer-double-tap gesture occurs. The motion event contains the final movement of the gesture.

Parameters
point the point
Returns
  • True if the listener has consumed the event, false otherwise.

public boolean onDragPointerMove (MotionEvent from, MotionEvent to)

Notified when a part of a single touch drag gesture event occurs. The touch pointer is moving from the "from" point to the "to" point.

Parameters
from The MotionEvent object containing full information about the "from" point.
to The MotionEvent object containing full information about the "to" point.
Returns
  • True if the listener has consumed the event, false otherwise.

public boolean onDragPointerUp (MotionEvent from, MotionEvent to)

Notified when a part of a single-touch-drag gesture event occurs. The drag gesture has finished. The motion events contain the final movement of the gesture.

Parameters
from The MotionEvent object containing full information about the "from" point.
to The MotionEvent object containing full information about the "to" point.
Returns
  • True if the listener has consumed the event, false otherwise.

public void onLongPress (MotionEvent point)

Notified when a long-press gesture occurs. The motion event contains the initial movement of the gesture.

Parameters
point The initial on down motion event that started the longpress.

public void onMultiPointersSingleTap (MotionEvent event)

Notified when a two-pointers-single-tap gesture occurs. The motion event contains the final movement of the gesture.

Parameters
event the event

public boolean onPinchPointersDown (MotionEvent event)

Notified when a part of a pinch gesture occurs. The gesture has started as a two pointers down motion.

Parameters
event the event
Returns
  • True if the listener has consumed the event, false otherwise.

public boolean onPinchPointersMove (MotionEvent event)

Notified when a part of a pinch gesture occurs. The two pointers of the gesture have moved. To get the move pointers you can:

float x1 = event.getX(0), y1 = event.getY(0), x2 = event.getX(1), y2 = event.getY(1);

Parameters
event the event
Returns
  • True if the listener has consumed the event, false otherwise.

public boolean onPinchPointersUp (MotionEvent event)

Notified when a part of a pinch gesture occurs. The pinch gesture has finished. The motion event contains the final movement of the gesture.

Parameters
event the event
Returns
  • True if the listener has consumed the event, false otherwise.

public boolean onSingleTap (MotionEvent point)

Notified when a single-pointer-single-tap gesture occurs. The motion event contains the initial movement of the gesture.

Parameters
point the point
Returns
  • True if the listener has consumed the event, false otherwise.

public boolean onTouch (View v, MotionEvent event)

Called when a touch event is dispatched to a view. This allows listeners to get a chance to respond before the target MapView.

Parameters
v the v
event the event
Returns
  • True if the listener has consumed the event, false otherwise.