From a39595177a4b393eb95f0d8284b2d21e3e4241a6 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 6 Jan 2020 10:14:46 +0200 Subject: [PATCH] Fix #8177 --- .../routepreparationmenu/RouteOptionsBottomSheet.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java index 370c14a4c1..f7c60f0d5e 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteOptionsBottomSheet.java @@ -61,7 +61,8 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { private RoutingHelper routingHelper; private RoutingOptionsHelper routingOptionsHelper; private ApplicationMode applicationMode; - @ColorRes private int selectedModeColorId; + @ColorRes + private int selectedModeColorId; private MapActivity mapActivity; @Override @@ -166,15 +167,15 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment { final BottomSheetItemWithCompoundButton[] timeConditionalRoutingItem = new BottomSheetItemWithCompoundButton[1]; timeConditionalRoutingItem[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder() .setCompoundButtonColorId(selectedModeColorId) - .setChecked(settings.ENABLE_TIME_CONDITIONAL_ROUTING.get()) + .setChecked(settings.ENABLE_TIME_CONDITIONAL_ROUTING.getModeValue(applicationMode)) .setIcon(getContentIcon((optionsItem.getActiveIconId()))) .setTitle(getString(R.string.temporary_conditional_routing)) .setLayoutId(R.layout.bottom_sheet_item_with_switch_56dp) .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - boolean enabled = !settings.ENABLE_TIME_CONDITIONAL_ROUTING.get(); - settings.ENABLE_TIME_CONDITIONAL_ROUTING.set(enabled); + boolean enabled = !settings.ENABLE_TIME_CONDITIONAL_ROUTING.getModeValue(applicationMode); + settings.ENABLE_TIME_CONDITIONAL_ROUTING.setModeValue(applicationMode, enabled); timeConditionalRoutingItem[0].setChecked(enabled); app.getRoutingHelper().recalculateRouteDueToSettingsChange(); }