Fix #6582
This commit is contained in:
parent
ac1d04896f
commit
00b135d881
19 changed files with 74 additions and 73 deletions
|
@ -163,6 +163,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
|
||||
private MapViewTrackingUtilities mapViewTrackingUtilities;
|
||||
private static MapContextMenu mapContextMenu = new MapContextMenu();
|
||||
private static MapRouteInfoMenu mapRouteInfoMenu = new MapRouteInfoMenu();
|
||||
private static Intent prevActivityIntent = null;
|
||||
|
||||
private List<ActivityResultListener> activityResultListeners = new ArrayList<>();
|
||||
|
@ -225,6 +226,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
landscapeLayout = !portraitMode && !largeDevice;
|
||||
mapViewTrackingUtilities = app.getMapViewTrackingUtilities();
|
||||
mapContextMenu.setMapActivity(this);
|
||||
mapRouteInfoMenu.setMapActivity(this);
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
// Full screen is not used here
|
||||
|
@ -445,10 +447,10 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
|
||||
@Override
|
||||
public void updateProgress(int progress) {
|
||||
mapLayers.getMapControlsLayer().getMapRouteInfoMenu().updateRouteCalculationProgress(progress);
|
||||
mapRouteInfoMenu.updateRouteCalculationProgress(progress);
|
||||
dashboardOnMap.updateRouteCalculationProgress(progress);
|
||||
if (findViewById(R.id.MapHudButtonsOverlay).getVisibility() == View.VISIBLE) {
|
||||
if (MapRouteInfoMenu.isVisible() || dashboardOnMap.isVisible()) {
|
||||
if (mapRouteInfoMenu.isVisible() || dashboardOnMap.isVisible()) {
|
||||
pb.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
|
@ -494,7 +496,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
|
||||
@Override
|
||||
public void finish() {
|
||||
mapLayers.getMapControlsLayer().getMapRouteInfoMenu().routeCalculationFinished();
|
||||
mapRouteInfoMenu.routeCalculationFinished();
|
||||
dashboardOnMap.routeCalculationFinished();
|
||||
pb.setVisibility(View.GONE);
|
||||
}
|
||||
|
@ -1117,9 +1119,9 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
TrackDetailsMenu trackDetailsMenu = mapLayers.getMapControlsLayer().getTrackDetailsMenu();
|
||||
trackDetailsMenu.setGpxItem((GpxDisplayItem) toShow);
|
||||
trackDetailsMenu.show();
|
||||
} else if (MapRouteInfoMenu.isVisible()) {
|
||||
} else if (mapRouteInfoMenu.isVisible()) {
|
||||
mapContextMenu.showMinimized(latLonToShow, mapLabelToShow, toShow);
|
||||
mapLayers.getMapControlsLayer().getMapRouteInfoMenu().updateMenu();
|
||||
mapRouteInfoMenu.updateMenu();
|
||||
MapRouteInfoMenu.showLocationOnMap(this, latLonToShow.getLatitude(), latLonToShow.getLongitude());
|
||||
} else if (toShow instanceof QuadRect) {
|
||||
QuadRect qr = (QuadRect) toShow;
|
||||
|
@ -1258,6 +1260,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mapContextMenu.setMapActivity(null);
|
||||
mapRouteInfoMenu.setMapActivity(null);
|
||||
unregisterReceiver(screenOffReceiver);
|
||||
app.getAidlApi().onDestroyMapActivity(this);
|
||||
FailSafeFuntions.quitRouteRestoreDialog();
|
||||
|
@ -1581,6 +1584,11 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
return mapContextMenu;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public MapRouteInfoMenu getMapRouteInfoMenu() {
|
||||
return mapRouteInfoMenu;
|
||||
}
|
||||
|
||||
public void openDrawer() {
|
||||
mapActions.updateDrawerMenu();
|
||||
boolean animate = !settings.DO_NOT_USE_ANIMATIONS.get();
|
||||
|
@ -1768,8 +1776,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
|
||||
@Override
|
||||
public void newRouteIsCalculated(boolean newRoute, ValueHolder<Boolean> showToast) {
|
||||
MapRouteInfoMenu routeInfoMenu = mapLayers.getMapControlsLayer().getMapRouteInfoMenu();
|
||||
if (routeInfoMenu.isSelectFromMapTouch()) {
|
||||
if (mapRouteInfoMenu.isSelectFromMapTouch()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1801,7 +1808,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
int tileBoxWidthPx = 0;
|
||||
int tileBoxHeightPx = 0;
|
||||
|
||||
WeakReference<MapRouteInfoMenuFragment> fragmentRef = routeInfoMenu.findMenuFragment();
|
||||
WeakReference<MapRouteInfoMenuFragment> fragmentRef = mapRouteInfoMenu.findMenuFragment();
|
||||
if (fragmentRef != null) {
|
||||
MapRouteInfoMenuFragment f = fragmentRef.get();
|
||||
if (landscapeLayout) {
|
||||
|
|
|
@ -1516,8 +1516,8 @@ public class ShowRouteInfoDialogFragment extends BaseOsmAndFragment {
|
|||
false,
|
||||
gpxItem);
|
||||
|
||||
final MapRouteInfoMenu mapRouteInfoMenu = activity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu();
|
||||
if (MapRouteInfoMenu.isVisible()) {
|
||||
final MapRouteInfoMenu mapRouteInfoMenu = activity.getMapRouteInfoMenu();
|
||||
if (mapRouteInfoMenu.isVisible()) {
|
||||
// We arrived here by the route info menu.
|
||||
// First, we close it and then show the details.
|
||||
mapRouteInfoMenu.setOnDismissListener(new OnDismissListener() {
|
||||
|
|
|
@ -619,7 +619,7 @@ public class ExternalApiHelper {
|
|||
}
|
||||
mapActivity.getMapActions().enterRoutePlanningModeGivenGpx(gpx, from, fromDesc, true, false);
|
||||
if (!app.getTargetPointsHelper().checkPointToNavigateShort()) {
|
||||
mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu().show();
|
||||
mapActivity.getMapRouteInfoMenu().show();
|
||||
} else {
|
||||
if (app.getSettings().APPLICATION_MODE.get() != routingHelper.getAppMode()) {
|
||||
app.getSettings().APPLICATION_MODE.set(routingHelper.getAppMode());
|
||||
|
|
|
@ -234,7 +234,7 @@ public class WaypointDialogHelper {
|
|||
|
||||
private static void updateRouteInfoMenu(Activity ctx) {
|
||||
if (ctx instanceof MapActivity) {
|
||||
((MapActivity) ctx).getMapLayers().getMapControlsLayer().getMapRouteInfoMenu().updateMenu();
|
||||
((MapActivity) ctx).getMapRouteInfoMenu().updateMenu();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@ import net.osmand.plus.mapcontextmenu.MenuController.MenuState;
|
|||
import net.osmand.plus.mapcontextmenu.MenuController.TitleButtonController;
|
||||
import net.osmand.plus.mapcontextmenu.MenuController.TitleProgressController;
|
||||
import net.osmand.plus.mapcontextmenu.controllers.TransportStopController;
|
||||
import net.osmand.plus.routepreparationmenu.MapRouteInfoMenu;
|
||||
import net.osmand.plus.transport.TransportStopRoute;
|
||||
import net.osmand.plus.views.AnimateDraggingMapThread;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
|
@ -1247,11 +1246,11 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
|
|||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (!menu.isActive() || MapRouteInfoMenu.isVisible()) {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (!menu.isActive() || (mapActivity != null && mapActivity.getMapRouteInfoMenu().isVisible())) {
|
||||
dismissMenu();
|
||||
return;
|
||||
}
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
updateLocationViewCache = mapActivity.getMyApplication().getUIUtilities().getUpdateLocationViewCache();
|
||||
mapActivity.getMapViewTrackingUtilities().setContextMenu(menu);
|
||||
|
|
|
@ -188,7 +188,7 @@ public class FavouritesBottomSheetMenuFragment extends MenuBottomSheetDialogFrag
|
|||
Activity activity = getActivity();
|
||||
if (activity instanceof MapActivity) {
|
||||
MapActivity map = ((MapActivity) activity);
|
||||
return map.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu();
|
||||
return map.getMapRouteInfoMenu();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ public class MapMultiSelectionMenuFragment extends Fragment implements MultiSele
|
|||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (MapRouteInfoMenu.isVisible()) {
|
||||
if (menu.getMapActivity().getMapRouteInfoMenu().isVisible()) {
|
||||
dismissMenu();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public class MapMarkerSelectionFragment extends BaseOsmAndDialogFragment {
|
|||
MapActivity mapActivity = getMapActivity();
|
||||
OsmandApplication app = getMyApplication();
|
||||
if (mapActivity != null) {
|
||||
MapRouteInfoMenu routeInfoMenu = mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu();
|
||||
MapRouteInfoMenu routeInfoMenu = mapActivity.getMapRouteInfoMenu();
|
||||
onClickListener = routeInfoMenu.getOnMarkerSelectListener();
|
||||
|
||||
screenOrientation = app.getUIUtilities().getScreenOrientation();
|
||||
|
|
|
@ -235,7 +235,7 @@ public class AddPointBottomSheetDialog extends MenuBottomSheetDialogFragment {
|
|||
public void onClick(View v) {
|
||||
MapActivity mapActivity = (MapActivity) getActivity();
|
||||
if (mapActivity != null) {
|
||||
MapRouteInfoMenu menu = mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu();
|
||||
MapRouteInfoMenu menu = mapActivity.getMapRouteInfoMenu();
|
||||
menu.selectOnScreen(pointType);
|
||||
}
|
||||
dismiss();
|
||||
|
@ -300,7 +300,7 @@ public class AddPointBottomSheetDialog extends MenuBottomSheetDialogFragment {
|
|||
public void onClick(View v) {
|
||||
MapActivity mapActivity = (MapActivity) getActivity();
|
||||
if (mapActivity != null) {
|
||||
MapRouteInfoMenu menu = mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu();
|
||||
MapRouteInfoMenu menu = mapActivity.getMapRouteInfoMenu();
|
||||
menu.selectMapMarker(-1, pointType);
|
||||
dismiss();
|
||||
}
|
||||
|
@ -311,7 +311,7 @@ public class AddPointBottomSheetDialog extends MenuBottomSheetDialogFragment {
|
|||
public void onClick(View v) {
|
||||
MapActivity mapActivity = (MapActivity) getActivity();
|
||||
if (mapActivity != null) {
|
||||
MapRouteInfoMenu menu = mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu();
|
||||
MapRouteInfoMenu menu = mapActivity.getMapRouteInfoMenu();
|
||||
menu.selectMapMarker(0, pointType);
|
||||
dismiss();
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ public class AvoidRoadsBottomSheetDialogFragment extends MenuBottomSheetDialogFr
|
|||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
mapActivity.getDashboard().setDashboardVisibility(false, DashboardOnMap.DashboardType.ROUTE_PREFERENCES);
|
||||
mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu().hide();
|
||||
mapActivity.getMapRouteInfoMenu().hide();
|
||||
app.getAvoidSpecificRoads().selectFromMap(mapActivity);
|
||||
Fragment fragment = getTargetFragment();
|
||||
if (fragment != null) {
|
||||
|
@ -281,11 +281,9 @@ public class AvoidRoadsBottomSheetDialogFragment extends MenuBottomSheetDialogFr
|
|||
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
final MapRouteInfoMenu mapRouteInfoMenu = mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu();
|
||||
if (mapRouteInfoMenu != null) {
|
||||
final MapRouteInfoMenu mapRouteInfoMenu = mapActivity.getMapRouteInfoMenu();
|
||||
mapRouteInfoMenu.updateMenu();
|
||||
}
|
||||
}
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import android.os.Bundle;
|
|||
import android.os.Handler;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.transition.AutoTransition;
|
||||
import android.support.transition.Scene;
|
||||
import android.support.transition.Transition;
|
||||
|
@ -68,7 +69,6 @@ import net.osmand.plus.routing.IRouteInformationListener;
|
|||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.routing.TransportRoutingHelper;
|
||||
import net.osmand.plus.search.QuickSearchHelper;
|
||||
import net.osmand.plus.views.MapControlsLayer;
|
||||
import net.osmand.router.GeneralRouter;
|
||||
import net.osmand.router.TransportRoutePlanner.TransportRouteResult;
|
||||
import net.osmand.search.SearchUICore.SearchResultCollection;
|
||||
|
@ -98,13 +98,12 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
}
|
||||
|
||||
public static int directionInfo = -1;
|
||||
private static boolean visible;
|
||||
public static boolean controlVisible = false;
|
||||
public static boolean chooseRoutesVisible = false;
|
||||
|
||||
private final RoutingHelper routingHelper;
|
||||
private final TransportRoutingHelper transportHelper;
|
||||
private final RoutingOptionsHelper routingOptionsHelper;
|
||||
private RoutingHelper routingHelper;
|
||||
private TransportRoutingHelper transportHelper;
|
||||
private RoutingOptionsHelper routingOptionsHelper;
|
||||
private GeocodingLookupService geocodingLookupService;
|
||||
private boolean routeCalculationInProgress;
|
||||
|
||||
|
@ -116,7 +115,6 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
private MapActivity mapActivity;
|
||||
private OsmandApplication app;
|
||||
private Handler animationsHandler;
|
||||
private MapControlsLayer mapControlsLayer;
|
||||
private boolean nightMode;
|
||||
private boolean switched;
|
||||
|
||||
|
@ -156,20 +154,25 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
WORK
|
||||
}
|
||||
|
||||
public MapRouteInfoMenu(MapActivity mapActivity, MapControlsLayer mapControlsLayer) {
|
||||
this.mapActivity = mapActivity;
|
||||
this.app = mapActivity.getMyApplication();
|
||||
this.mapControlsLayer = mapControlsLayer;
|
||||
this.routingHelper = mapActivity.getRoutingHelper();
|
||||
this.transportHelper = routingHelper.getTransportRoutingHelper();
|
||||
this.routingOptionsHelper = app.getRoutingOptionsHelper();
|
||||
this.animationsHandler = new Handler();
|
||||
public MapRouteInfoMenu() {
|
||||
}
|
||||
|
||||
routingHelper.addListener(this);
|
||||
public void setMapActivity(@Nullable MapActivity mapActivity) {
|
||||
this.mapActivity = mapActivity;
|
||||
if (mapActivity != null) {
|
||||
if (app == null) {
|
||||
app = mapActivity.getMyApplication();
|
||||
}
|
||||
routingHelper = app.getRoutingHelper();
|
||||
transportHelper = routingHelper.getTransportRoutingHelper();
|
||||
routingOptionsHelper = app.getRoutingOptionsHelper();
|
||||
portraitMode = AndroidUiHelper.isOrientationPortrait(mapActivity);
|
||||
geocodingLookupService = app.getGeocodingLookupService();
|
||||
}
|
||||
animationsHandler = new Handler();
|
||||
routingHelper.addListener(this);
|
||||
currentMenuState = getInitialMenuState();
|
||||
|
||||
geocodingLookupService = mapActivity.getMyApplication().getGeocodingLookupService();
|
||||
onMarkerSelectListener = new OnMarkerSelectListener() {
|
||||
@Override
|
||||
public void onSelect(int index, PointType pointType) {
|
||||
|
@ -1013,12 +1016,12 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
if (isTransportRouteCalculated()) {
|
||||
ChooseRouteFragment.showInstance(mapActivity.getSupportFragmentManager());
|
||||
} else {
|
||||
mapControlsLayer.startNavigation();
|
||||
mapActivity.getMapLayers().getMapControlsLayer().startNavigation();
|
||||
}
|
||||
}
|
||||
|
||||
private void clickRouteCancel() {
|
||||
mapControlsLayer.stopNavigation();
|
||||
mapActivity.getMapLayers().getMapControlsLayer().stopNavigation();
|
||||
setRouteCalculationInProgress(false);
|
||||
restoreCollapsedButtons();
|
||||
}
|
||||
|
@ -1234,7 +1237,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
@Override
|
||||
public void run() {
|
||||
boolean started = false;
|
||||
if (visible && mainView != null) {
|
||||
if (isVisible() && mainView != null) {
|
||||
ViewGroup container = (ViewGroup) mainView.findViewById(containerRes);
|
||||
View v = mainView.findViewById(viewRes);
|
||||
if (container != null && v != null && v.getVisibility() == View.VISIBLE) {
|
||||
|
@ -1244,7 +1247,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
@Override
|
||||
public void onTransitionEnd(@NonNull Transition transition) {
|
||||
if (listener != null) {
|
||||
listener.onButtonCollapsed(visible);
|
||||
listener.onButtonCollapsed(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1373,8 +1376,8 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
return directionInfo;
|
||||
}
|
||||
|
||||
public static boolean isVisible() {
|
||||
return visible;
|
||||
public boolean isVisible() {
|
||||
return findMenuFragment() != null;
|
||||
}
|
||||
|
||||
public WeakReference<MapRouteInfoMenuFragment> findMenuFragment() {
|
||||
|
@ -1395,7 +1398,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
int tileBoxWidthPx = 0;
|
||||
int tileBoxHeightPx = 0;
|
||||
|
||||
MapRouteInfoMenu routeInfoMenu = mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu();
|
||||
MapRouteInfoMenu routeInfoMenu = mapActivity.getMapRouteInfoMenu();
|
||||
WeakReference<MapRouteInfoMenuFragment> fragmentRef = routeInfoMenu.findMenuFragment();
|
||||
if (fragmentRef != null) {
|
||||
MapRouteInfoMenuFragment f = fragmentRef.get();
|
||||
|
@ -1536,14 +1539,13 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
}
|
||||
|
||||
public void onDismiss() {
|
||||
visible = false;
|
||||
cancelButtonsAnimations();
|
||||
mapActivity.getMapView().setMapPositionX(0);
|
||||
mapActivity.getMapView().refreshMap();
|
||||
AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.map_route_land_left_margin), false);
|
||||
AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.map_right_widgets_panel), true);
|
||||
if (switched) {
|
||||
mapControlsLayer.switchToRouteFollowingLayout();
|
||||
mapActivity.getMapLayers().getMapControlsLayer().switchToRouteFollowingLayout();
|
||||
}
|
||||
if (getTargets().getPointToNavigate() == null && !selectFromMapTouch) {
|
||||
mapActivity.getMapActions().stopNavigationWithoutConfirm();
|
||||
|
@ -1559,10 +1561,9 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
}
|
||||
|
||||
public void show(int menuState) {
|
||||
if (!visible) {
|
||||
if (!isVisible()) {
|
||||
currentMenuState = menuState;
|
||||
visible = true;
|
||||
switched = mapControlsLayer.switchToRoutePlanningLayout();
|
||||
switched = mapActivity.getMapLayers().getMapControlsLayer().switchToRoutePlanningLayout();
|
||||
boolean refreshMap = !switched;
|
||||
boolean portrait = AndroidUiHelper.isOrientationPortrait(mapActivity);
|
||||
if (!portrait) {
|
||||
|
@ -1590,8 +1591,6 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
WeakReference<MapRouteInfoMenuFragment> fragmentRef = findMenuFragment();
|
||||
if (fragmentRef != null) {
|
||||
fragmentRef.get().dismiss();
|
||||
} else {
|
||||
visible = false;
|
||||
}
|
||||
routingHelper.removeListener(this);
|
||||
removeTargetPointListener();
|
||||
|
|
|
@ -113,7 +113,7 @@ public class MapRouteInfoMenuFragment extends BaseOsmAndFragment {
|
|||
|
||||
portrait = AndroidUiHelper.isOrientationPortrait(mapActivity);
|
||||
|
||||
menu = mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu();
|
||||
menu = mapActivity.getMapRouteInfoMenu();
|
||||
shadowHeight = AndroidUtils.getStatusBarHeight(mapActivity);
|
||||
topScreenPosY = addStatusBarHeightIfNeeded(0);
|
||||
minHalfY = viewHeight - (int) (viewHeight * .75f);
|
||||
|
|
|
@ -13,8 +13,8 @@ import android.widget.TextView;
|
|||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.CallbackWithObject;
|
||||
import net.osmand.plus.ApplicationMode;
|
||||
import net.osmand.GPXUtilities;
|
||||
import net.osmand.plus.ApplicationMode;
|
||||
import net.osmand.plus.OsmAndLocationProvider;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandPlugin;
|
||||
|
@ -342,9 +342,9 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment {
|
|||
}
|
||||
|
||||
private void updateMenu() {
|
||||
final MapRouteInfoMenu mapRouteInfoMenu = getMapActivity().getMapLayers().getMapControlsLayer().getMapRouteInfoMenu();
|
||||
if (mapRouteInfoMenu != null) {
|
||||
mapRouteInfoMenu.updateMenu();
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
mapActivity.getMapRouteInfoMenu().updateMenu();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ public class RoutingOptionsHelper {
|
|||
|
||||
public void selectRestrictedRoads(final MapActivity mapActivity) {
|
||||
mapActivity.getDashboard().setDashboardVisibility(false, DashboardOnMap.DashboardType.ROUTE_PREFERENCES);
|
||||
mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu().hide();
|
||||
mapActivity.getMapRouteInfoMenu().hide();
|
||||
mapActivity.getMyApplication().getAvoidSpecificRoads().showDialog(mapActivity);
|
||||
}
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
|
|||
if (activeObjects.isEmpty() || isContainsOnlyStart(activeObjects)) {
|
||||
mapActivity.getMapActions().stopNavigationWithoutConfirm();
|
||||
mapActivity.getMyApplication().getTargetPointsHelper().removeAllWayPoints(false, true);
|
||||
mapActivity.getMapLayers().getMapControlsLayer().getMapRouteInfoMenu().hide();
|
||||
mapActivity.getMapRouteInfoMenu().hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -130,10 +130,6 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
contextMenuLayer = mapActivity.getMapLayers().getContextMenuLayer();
|
||||
}
|
||||
|
||||
public MapRouteInfoMenu getMapRouteInfoMenu() {
|
||||
return mapRouteInfoMenu;
|
||||
}
|
||||
|
||||
public TrackDetailsMenu getTrackDetailsMenu() {
|
||||
return trackDetailsMenu;
|
||||
}
|
||||
|
@ -300,7 +296,7 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
}
|
||||
|
||||
private void initRouteControls() {
|
||||
mapRouteInfoMenu = new MapRouteInfoMenu(mapActivity, this);
|
||||
mapRouteInfoMenu = mapActivity.getMapRouteInfoMenu();
|
||||
trackDetailsMenu = new TrackDetailsMenu(mapActivity);
|
||||
}
|
||||
|
||||
|
@ -759,7 +755,7 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
routePlanningMode = true;
|
||||
}
|
||||
boolean routeFollowingMode = !routePlanningMode && rh.isFollowingMode();
|
||||
boolean routeDialogOpened = MapRouteInfoMenu.isVisible();
|
||||
boolean routeDialogOpened = mapRouteInfoMenu.isVisible();
|
||||
boolean trackDialogOpened = TrackDetailsMenu.isVisible();
|
||||
boolean contextMenuOpened = !mapActivity.getContextMenu().shouldShowTopControls();
|
||||
boolean showRouteCalculationControls = routePlanningMode ||
|
||||
|
|
|
@ -894,7 +894,7 @@ public class MapInfoWidgetsFactory {
|
|||
}
|
||||
} else {
|
||||
int di = MapRouteInfoMenu.getDirectionInfo();
|
||||
if (di >= 0 && MapRouteInfoMenu.isVisible() &&
|
||||
if (di >= 0 && map.getMapRouteInfoMenu().isVisible() &&
|
||||
di < routingHelper.getRouteDirections().size()) {
|
||||
showNextTurn = true;
|
||||
RouteDirectionInfo next = routingHelper.getRouteDirections().get(di);
|
||||
|
|
|
@ -201,7 +201,7 @@ public class MapMarkersWidgetsFactory {
|
|||
|| !map.getMyApplication().getSettings().MAP_MARKERS_MODE.get().isToolbar()
|
||||
|| map.getMyApplication().getRoutingHelper().isFollowingMode()
|
||||
|| map.getMyApplication().getRoutingHelper().isRoutePlanningMode()
|
||||
|| MapRouteInfoMenu.isVisible()
|
||||
|| map.getMapRouteInfoMenu().isVisible()
|
||||
|| addressTopBar.getVisibility() == View.VISIBLE
|
||||
|| map.isTopToolbarActive()
|
||||
|| !map.getContextMenu().shouldShowTopControls()
|
||||
|
|
|
@ -755,6 +755,7 @@ public class RouteInfoWidgetsFactory {
|
|||
public static class LanesControl {
|
||||
private MapViewTrackingUtilities trackingUtilities;
|
||||
private OsmAndLocationProvider locationProvider;
|
||||
private MapRouteInfoMenu mapRouteInfoMenu;
|
||||
private RoutingHelper rh;
|
||||
private OsmandSettings settings;
|
||||
private ImageView lanesView;
|
||||
|
@ -776,6 +777,7 @@ public class RouteInfoWidgetsFactory {
|
|||
trackingUtilities = map.getMapViewTrackingUtilities();
|
||||
locationProvider = map.getMyApplication().getLocationProvider();
|
||||
settings = map.getMyApplication().getSettings();
|
||||
mapRouteInfoMenu = map.getMapRouteInfoMenu();
|
||||
rh = map.getMyApplication().getRoutingHelper();
|
||||
app = map.getMyApplication();
|
||||
}
|
||||
|
@ -817,7 +819,7 @@ public class RouteInfoWidgetsFactory {
|
|||
}
|
||||
} else {
|
||||
int di = MapRouteInfoMenu.getDirectionInfo();
|
||||
if (di >= 0 && MapRouteInfoMenu.isVisible()
|
||||
if (di >= 0 && mapRouteInfoMenu.isVisible()
|
||||
&& di < rh.getRouteDirections().size()) {
|
||||
RouteDirectionInfo next = rh.getRouteDirections().get(di);
|
||||
if (next != null) {
|
||||
|
|
Loading…
Reference in a new issue