Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] #2805 - Placeholder for a ShoveGestureListener
Browse files Browse the repository at this point in the history
  • Loading branch information
zugaldia committed Dec 3, 2015
1 parent 4567d7d commit 3ce3656
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 3ce3656

Please sign in to comment.