@Override public boolean onTouchEvent(final MotionEvent event, final MapView mapView) { if (mDraggable && mIsDragged) { if (event.getAction() == MotionEvent.ACTION_UP) { mIsDragged = false; if (mOnMarkerDragListener != null) mOnMarkerDragListener.onMarkerDragEnd(this); return true; } else if (event.getAction() == MotionEvent.ACTION_MOVE) { moveToEventPosition(event, mapView); if (mOnMarkerDragListener != null) mOnMarkerDragListener.onMarkerDrag(this); return true; } else return false; } else return false; }
@Override public boolean onLongPress(final MotionEvent event, final MapView mapView) { boolean touched = hitTest(event, mapView); if (touched) { if (mDraggable) { // starts dragging mode: mIsDragged = true; closeInfoWindow(); if (mOnMarkerDragListener != null) mOnMarkerDragListener.onMarkerDragStart(this); moveToEventPosition(event, mapView); } } return touched; }