From 624799e58b262c1f8196afc28850161da0f7cd4a Mon Sep 17 00:00:00 2001 From: sonora Date: Wed, 28 Dec 2016 19:39:29 +0100 Subject: [PATCH] cancel touch events in all layers if multitouch is in use --- OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java | 2 +- OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java index e7a112529f..1a3758bb54 100644 --- a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java +++ b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java @@ -88,7 +88,7 @@ public class MultiTouchSupport { if(inZoomMode){ listener.onZoomOrRotationEnded(zoomRelative, angleRelative); inZoomMode = false; - //return true; + return true; } return false; } diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index 20d20e652e..a214ad1281 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -862,6 +862,12 @@ public class OsmandMapTileView implements IMapDownloaderCallback { layers.get(i).onTouchEvent(event, getCurrentRotatedTileBox()); } gestureDetector.onTouchEvent(event); + } else { + MotionEvent cancelEvent == MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis() + 100, MotionEvent.ACTION_CANCEL, 0.0f, 0.0f, 0); + for (int i = layers.size() - 1; i >= 0; i--) { + layers.get(i).onTouchEvent(cancelEvent, getCurrentRotatedTileBox()); + } + gestureDetector.onTouchEvent(cancelEvent); } return true; }