From cd757e35167b8ce3ee519ff7076db16aa435e538 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Sat, 3 Feb 2018 14:44:50 +0300 Subject: [PATCH] Fix #4628 --- .../osmand/plus/mapcontextmenu/MapContextMenuFragment.java | 7 +++---- OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index 44cbccb639..068327a5af 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -316,12 +316,9 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo @Override public boolean onTouch(View v, MotionEvent event) { - if (event.getY() <= menuTopViewHeight) { + if (!hasMoved && event.getY() <= menuTopViewHeight) { if (singleTapDetector.onTouchEvent(event)) { moving = false; - if (hasMoved) { - applyPosY(getViewY(), false, false, 0, 0, 0); - } openMenuHalfScreen(); recycleVelocityTracker(); @@ -383,6 +380,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo case MotionEvent.ACTION_UP: if (moving) { moving = false; + hasMoved = false; int currentY = getViewY(); final VelocityTracker velocityTracker = this.velocityTracker; @@ -413,6 +411,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo break; case MotionEvent.ACTION_CANCEL: moving = false; + hasMoved = false; recycleVelocityTracker(); break; diff --git a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java index dd6ea9d755..54d8b24d86 100644 --- a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java @@ -604,6 +604,9 @@ public class ContextMenuLayer extends OsmandMapLayer { if (entry.getKey().startsWith("name:") && !entry.getValue().equals("")) { names.add(entry.getValue()); } + if (entry.getKey().equals("name") && !entry.getValue().equals("")) { + names.add(entry.getValue()); + } } LatLon searchLatLon = objectLatLon; if (searchLatLon == null) {