From d18247de179a3c66668ca302b607c58451e933ee Mon Sep 17 00:00:00 2001 From: sonora Date: Sun, 1 Jan 2017 19:36:50 +0100 Subject: [PATCH] try mask single tap after 2 finger tap --- OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index f78d82a844..6e91e33e23 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -157,7 +157,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback { private MultiTouchSupport multiTouchSupport; private DoubleTapScaleDetector doubleTapScaleDetector; private TwoFingerTapDetector twoFingersTapDetector; - //private boolean afterTwoFingersTap = false; + private boolean afterTwoFingersTap = false; private boolean afterDoubleTap = false; public OsmandMapTileView(MapActivity activity, int w, int h) { @@ -218,7 +218,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback { twoFingersTapDetector = new TwoFingerTapDetector() { @Override public void onTwoFingerTap() { - //afterTwoFingersTap = true; + afterTwoFingersTap = true; if (isZoomingAllowed(getZoom(), -1.1f)) { getAnimatedDraggingThread().startZooming(getZoom() - 1, currentViewport.getZoomFloatPart(), true); } @@ -1126,9 +1126,10 @@ public class OsmandMapTileView implements IMapDownloaderCallback { @Override public boolean onSingleTapConfirmed(MotionEvent e) { - if (doubleTapScaleDetector.isDoubleTapping() || afterDoubleTap) { + if (doubleTapScaleDetector.isDoubleTapping() || afterDoubleTap || afterTwoFingersTap) { // Needed to suppress false single tap detection if we mask MotionEvents for gestures on isDoubleTapping() afterDoubleTap = false; + afterTwoFingersTap = false; return true; } PointF point = new PointF(e.getX(), e.getY());