From 3ce3656eb54c0ecdb51b0823e6fca8202bd7c4cb Mon Sep 17 00:00:00 2001 From: Antonio Zugaldia Date: Thu, 3 Dec 2015 14:36:23 -0500 Subject: [PATCH] [android] #2805 - Placeholder for a ShoveGestureListener --- .../com/mapbox/mapboxsdk/views/MapView.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/MapView.java b/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/MapView.java index 38f93f6d9fd..e3a38eb52d3 100644 --- a/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/MapView.java +++ b/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/MapView.java @@ -53,6 +53,7 @@ import android.widget.ZoomButtonsController; import com.almeros.android.multitouch.gesturedetectors.RotateGestureDetector; +import com.almeros.android.multitouch.gesturedetectors.ShoveGestureDetector; import com.almeros.android.multitouch.gesturedetectors.TwoFingerGestureDetector; import com.mapbox.mapboxsdk.R; import com.mapbox.mapboxsdk.annotations.Annotation; @@ -180,6 +181,7 @@ public final class MapView extends FrameLayout { private GestureDetectorCompat mGestureDetector; private ScaleGestureDetector mScaleGestureDetector; private RotateGestureDetector mRotateGestureDetector; + private ShoveGestureDetector mShoveGestureDetector; private boolean mTwoTap = false; private boolean mZoomStarted = false; private boolean mQuickZoom = false; @@ -682,6 +684,7 @@ private void initialize(Context context, AttributeSet attrs) { mScaleGestureDetector = new ScaleGestureDetector(context, new ScaleGestureListener()); ScaleGestureDetectorCompat.setQuickScaleEnabled(mScaleGestureDetector, true); mRotateGestureDetector = new RotateGestureDetector(context, new RotateGestureListener()); + mShoveGestureDetector = new ShoveGestureDetector(context, new ShoveGestureListener()); // Shows the zoom controls if (!context.getPackageManager() @@ -2831,6 +2834,26 @@ public boolean onRotate(RotateGestureDetector detector) { } } + // This class handles a vertical two-finger shove. (If you place two fingers on screen with + // less than a 20 degree angle between them, this will detect movement on the Y-axis.) + private class ShoveGestureListener implements ShoveGestureDetector.OnShoveGestureListener { + + @Override + public boolean onShove(ShoveGestureDetector detector) { + return false; + } + + @Override + public boolean onShoveBegin(ShoveGestureDetector detector) { + return false; + } + + @Override + public void onShoveEnd(ShoveGestureDetector detector) { + + } + } + // This class handles input events from the zoom control buttons // Zoom controls allow single touch only devices to zoom in and out private class OnZoomListener implements ZoomButtonsController.OnZoomListener {