From eb0a50187399db2ab62e80cbec803dea8363f33e Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 4 Aug 2017 14:15:14 +0300 Subject: [PATCH] Disable single and long tap --- .../measurementtool/MeasurementToolLayer.java | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java index 8cc17bcd27..d9217340a2 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java @@ -5,22 +5,26 @@ import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; +import android.graphics.PointF; import net.osmand.data.LatLon; +import net.osmand.data.PointDescription; import net.osmand.data.QuadPoint; import net.osmand.data.RotatedTileBox; import net.osmand.plus.GPXUtilities.WptPt; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.R; +import net.osmand.plus.views.ContextMenuLayer; import net.osmand.plus.views.OsmandMapLayer; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.util.MapUtils; import java.util.LinkedList; +import java.util.List; import gnu.trove.list.array.TIntArrayList; -public class MeasurementToolLayer extends OsmandMapLayer { +public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider { private OsmandMapTileView view; private boolean inMeasurementMode; @@ -177,4 +181,34 @@ public class MeasurementToolLayer extends OsmandMapLayer { public boolean drawInScreenPixels() { return false; } + + @Override + public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List o) { + + } + + @Override + public LatLon getObjectLocation(Object o) { + return null; + } + + @Override + public PointDescription getObjectName(Object o) { + return null; + } + + @Override + public boolean disableSingleTap() { + return isInMeasurementMode(); + } + + @Override + public boolean disableLongPressOnMap() { + return isInMeasurementMode(); + } + + @Override + public boolean isObjectClickable(Object o) { + return !isInMeasurementMode(); + } }