diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 0aa8d181e5..b44add42a8 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1411,7 +1411,7 @@ public class OsmandSettings { public final OsmandPreference SHOW_MAPILLARY = new BooleanPreference("show_mapillary", false).makeProfile(); public final OsmandPreference MAPILLARY_FIRST_DIALOG_SHOWN = new BooleanPreference("mapillary_first_dialog_shown", false).makeGlobal(); - public final OsmandPreference ONLINE_PHOTOS_ROW_COLLAPSED = new BooleanPreference("mapillary_menu_collapsed", false).makeGlobal(); + public final OsmandPreference ONLINE_PHOTOS_ROW_COLLAPSED = new BooleanPreference("mapillary_menu_collapsed", true).makeGlobal(); public final OsmandPreference WEBGL_SUPPORTED = new BooleanPreference("webgl_supported", true).makeGlobal(); // this value string is synchronized with settings_pref.xml preference name diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java index 095394e5b4..1d92f245c3 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java @@ -824,7 +824,8 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener if (mapActivity == null || mainView == null) { return; } - final ApplicationMode am = mapActivity.getMyApplication().getRoutingHelper().getAppMode(); + OsmandApplication app = mapActivity.getMyApplication(); + final ApplicationMode am = app.getRoutingHelper().getAppMode(); final Set selected = new HashSet<>(); selected.add(am); ViewGroup vg = (ViewGroup) mainView.findViewById(R.id.app_modes); @@ -843,7 +844,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener } } }; - final List values = new ArrayList(ApplicationMode.values(mapActivity.getMyApplication())); + final List values = new ArrayList(ApplicationMode.values(app)); values.remove(ApplicationMode.DEFAULT); if (values.size() > 0 && !values.contains(am)) { @@ -866,8 +867,8 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener boolean firstMode = true; while (iterator.hasNext()) { ApplicationMode mode = iterator.next(); - View toggle = AppModeDialog.createToggle(mapActivity.getLayoutInflater(), (OsmandApplication) mapActivity.getApplication(), - R.layout.mode_view_route_preparation, (LinearLayout) ll.findViewById(R.id.app_modes_content), mode, true); + View toggle = AppModeDialog.createToggle(mapActivity.getLayoutInflater(), app, R.layout.mode_view_route_preparation, + (LinearLayout) ll.findViewById(R.id.app_modes_content), mode, true); if (firstMode && toggle.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) { firstMode = false; @@ -882,10 +883,11 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener buttons[k++] = toggle; } for (int i = 0; i < buttons.length; i++) { - AppModeDialog.updateButtonStateForRoute((OsmandApplication) mapActivity.getApplication(), values, selected, listener, buttons, i, true, true, nightMode); + AppModeDialog.updateButtonStateForRoute(app, values, selected, listener, buttons, i, true, true, nightMode); } - final ApplicationMode activeMode = app.getSettings().getApplicationMode(); + final ApplicationMode activeMode = app.getRoutingHelper().getAppMode(); + final int idx = values.indexOf(activeMode); OnGlobalLayoutListener globalListener = new OnGlobalLayoutListener() {