From 2c74e887a1054283f91313ec8f34c39c259b05de Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Fri, 1 Apr 2016 13:03:34 +0300 Subject: [PATCH] Fix https://github.com/osmandapp/Osmand/issues/2389 --- .../plus/audionotes/AudioVideoNotesPlugin.java | 3 +++ .../plus/mapcontextmenu/MapContextMenu.java | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index bf81bc6984..5ad4ed0a5b 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -1533,6 +1533,9 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { if (mapActivity != null && rec != null) { MapContextMenu menu = mapActivity.getContextMenu(); menu.show(new LatLon(rec.lat, rec.lon), audioNotesLayer.getObjectName(rec), rec); + if (app.getRoutingHelper().isFollowingMode()) { + menu.hideWithTimeout(3000); + } } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 84f980b830..915b6e8094 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -71,6 +71,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL private boolean inLocationUpdate = false; private boolean appModeChanged; private boolean appModeListenerAdded; + private boolean autoHide; private int favActionIconId; @@ -300,6 +301,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL active = false; } centerMarker = false; + autoHide = false; } } @@ -348,6 +350,19 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL } } + // timeout in msec + public void hideWithTimeout(long timeout) { + autoHide = true; + mapActivity.getMyApplication().runInUIThread(new Runnable() { + @Override + public void run() { + if (autoHide) { + hide(); + } + } + }, timeout); + } + public void updateMenuUI() { WeakReference fragmentRef = findMenuFragment(); if (fragmentRef != null) {