This commit is contained in:
Alexey Kulish 2018-02-03 14:44:50 +03:00
parent 3de5811add
commit cd757e3516
2 changed files with 6 additions and 4 deletions

View file

@ -316,12 +316,9 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
@Override @Override
public boolean onTouch(View v, MotionEvent event) { public boolean onTouch(View v, MotionEvent event) {
if (event.getY() <= menuTopViewHeight) { if (!hasMoved && event.getY() <= menuTopViewHeight) {
if (singleTapDetector.onTouchEvent(event)) { if (singleTapDetector.onTouchEvent(event)) {
moving = false; moving = false;
if (hasMoved) {
applyPosY(getViewY(), false, false, 0, 0, 0);
}
openMenuHalfScreen(); openMenuHalfScreen();
recycleVelocityTracker(); recycleVelocityTracker();
@ -383,6 +380,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP:
if (moving) { if (moving) {
moving = false; moving = false;
hasMoved = false;
int currentY = getViewY(); int currentY = getViewY();
final VelocityTracker velocityTracker = this.velocityTracker; final VelocityTracker velocityTracker = this.velocityTracker;
@ -413,6 +411,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
break; break;
case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_CANCEL:
moving = false; moving = false;
hasMoved = false;
recycleVelocityTracker(); recycleVelocityTracker();
break; break;

View file

@ -604,6 +604,9 @@ public class ContextMenuLayer extends OsmandMapLayer {
if (entry.getKey().startsWith("name:") && !entry.getValue().equals("")) { if (entry.getKey().startsWith("name:") && !entry.getValue().equals("")) {
names.add(entry.getValue()); names.add(entry.getValue());
} }
if (entry.getKey().equals("name") && !entry.getValue().equals("")) {
names.add(entry.getValue());
}
} }
LatLon searchLatLon = objectLatLon; LatLon searchLatLon = objectLatLon;
if (searchLatLon == null) { if (searchLatLon == null) {