Interface MapView.OnTouchListener

  • All Superinterfaces:
    android.view.GestureDetector.OnDoubleTapListener, android.view.GestureDetector.OnGestureListener, android.view.ScaleGestureDetector.OnScaleGestureListener, android.view.View.OnTouchListener
    All Known Implementing Classes:
    DefaultMapViewOnTouchListener
    Enclosing class:
    MapView

    public static interface MapView.OnTouchListener
    extends android.view.View.OnTouchListener, android.view.GestureDetector.OnGestureListener, android.view.GestureDetector.OnDoubleTapListener, android.view.ScaleGestureDetector.OnScaleGestureListener
    Defines single and multitouch gesture events that can occur on the MapView, such as a multi-pointer tap. These are combined with events defined by the inherited Android framework touch and gesture interfaces.

    This interface is implemented by the DefaultMapViewOnTouchListener, which provides the default gesture handling behaviour for the MapView.

    You can override the standard gestures by creating your own touch listener class. To do this, implement this interface, and pass an instance of your touch listener class to setOnTouchListener. Alternatively, if only some gestures need to be overridden, you may wish to inherit from DefaultMapViewOnTouchListener instead.

    Since:
    100.0.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean onDoubleTouchDrag​(android.view.MotionEvent e)
      Notified when a double-tap-and-drag gesture is performed on the MapView.
      boolean onMultiPointerTap​(android.view.MotionEvent e)
      Notified when a multi-pointer-tap gesture is performed on the MapView.
      boolean onRotate​(android.view.MotionEvent e, double angle)
      Notified when a rotate gesture is performed on the MapView.
      boolean onUp​(android.view.MotionEvent e)
      Notified when a pointer is lifted up, following any combination of gesture actions.
      • Methods inherited from interface android.view.GestureDetector.OnDoubleTapListener

        onDoubleTap, onDoubleTapEvent, onSingleTapConfirmed
      • Methods inherited from interface android.view.GestureDetector.OnGestureListener

        onDown, onFling, onLongPress, onScroll, onShowPress, onSingleTapUp
      • Methods inherited from interface android.view.ScaleGestureDetector.OnScaleGestureListener

        onScale, onScaleBegin, onScaleEnd
      • Methods inherited from interface android.view.View.OnTouchListener

        onTouch
    • Method Detail

      • onMultiPointerTap

        boolean onMultiPointerTap​(android.view.MotionEvent e)
        Notified when a multi-pointer-tap gesture is performed on the MapView. The gesture consists of a single tap with multiple pointers on the screen.
        Parameters:
        e - the motion event that completed the multi-pointer tap gesture
        Returns:
        true if the listener has consumed the event; false otherwise
        Since:
        100.0.0
      • onDoubleTouchDrag

        boolean onDoubleTouchDrag​(android.view.MotionEvent e)
        Notified when a double-tap-and-drag gesture is performed on the MapView. The gesture consists of a single-pointer double-tap where instead of lifting the pointer after the second tap, it is held on the screen and then dragged.
        Parameters:
        e - the motion event that triggered the current onDoubleTouchDrag gesture
        Returns:
        true if the listener has consumed the event; false otherwise
        Since:
        100.0.0
      • onUp

        boolean onUp​(android.view.MotionEvent e)
        Notified when a pointer is lifted up, following any combination of gesture actions. This can be used, for example, to detect when a pointer is lifted after a long-press gesture has been used to show the built-in magnifier.
        Parameters:
        e - the motion event that completed the last gesture, triggering this onUp call
        Returns:
        true if the listener has consumed the event; false otherwise
        Since:
        100.0.0
      • onRotate

        boolean onRotate​(android.view.MotionEvent e,
                         double angle)
        Notified when a rotate gesture is performed on the MapView. The gesture consists of two pointers rotating clockwise or counter clockwise around a midpoint.
        Parameters:
        e - the motion event that triggered the current onRotate
        angle - the angle of rotation of the current rotation gesture, in degrees counterclockwise. Negative numbers indicate clockwise rotation.
        Returns:
        true if the listener has consumed the event; false otherwise
        Since:
        100.0.0