From 37793ec964d2d8cf35e631de5902ff786aa3dc06 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Mon, 7 Nov 2016 20:23:58 +0300 Subject: [PATCH] Fix #3241 --- OsmAnd/src/net/osmand/plus/activities/MapActivity.java | 6 +++--- .../osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 4bacaf0366..319c4a1a69 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -4,7 +4,6 @@ import android.Manifest; import android.app.Activity; import android.app.AlarmManager; import android.app.Dialog; -import android.app.NotificationManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; @@ -72,9 +71,9 @@ import net.osmand.plus.base.FailSafeFuntions; import net.osmand.plus.base.MapViewTrackingUtilities; import net.osmand.plus.dashboard.DashboardOnMap; import net.osmand.plus.dialogs.ErrorBottomSheetDialog; -import net.osmand.plus.dialogs.XMasDialogFragment; import net.osmand.plus.dialogs.RateUsBottomSheetDialog; import net.osmand.plus.dialogs.WhatsNewDialogFragment; +import net.osmand.plus.dialogs.XMasDialogFragment; import net.osmand.plus.download.DownloadActivity; import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents; import net.osmand.plus.download.ui.DataStoragePlaceDialogFragment; @@ -114,7 +113,6 @@ import org.apache.commons.logging.Log; import java.io.File; import java.lang.ref.WeakReference; import java.util.ArrayList; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -783,6 +781,8 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven if (mapLayers.getMapControlsLayer().getMapRouteInfoMenu().isVisible()) { mapContextMenu.showMinimized(latLonToShow, mapLabelToShow, toShow); mapLayers.getMapControlsLayer().getMapRouteInfoMenu().updateMenu(); + mapView.getAnimatedDraggingThread().startMoving(latLonToShow.getLatitude(), + latLonToShow.getLongitude(), settings.getMapZoomToShow(), true); } else { mapContextMenu.show(latLonToShow, mapLabelToShow, toShow); } diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java index 90bff71da4..8c9a535c58 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java @@ -562,7 +562,8 @@ public class MapInfoWidgetsFactory { } } else { int di = MapRouteInfoMenu.getDirectionInfo(); - if (di >= 0 && MapRouteInfoMenu.isControlVisible() && + MapRouteInfoMenu routeInfoMenu = map.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu(); + if (di >= 0 && routeInfoMenu != null && routeInfoMenu.isVisible() && di < routingHelper.getRouteDirections().size()) { showNextTurn = true; RouteDirectionInfo next = routingHelper.getRouteDirections().get(di); @@ -575,7 +576,8 @@ public class MapInfoWidgetsFactory { if (text == null) { text = ""; } - + } else { + text = null; } } } else if (map.getMapViewTrackingUtilities().isMapLinkedToLocation() &&