mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-17 08:24:48 +00:00
[android] Add UI for avoiding steps
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
@@ -31,7 +31,8 @@ public class DrivingOptionsScreen extends BaseMapScreen
|
||||
private final DrivingOption[] mDrivingOptions = {new DrivingOption(RoadType.Toll, R.string.avoid_tolls),
|
||||
new DrivingOption(RoadType.Dirty, R.string.avoid_unpaved),
|
||||
new DrivingOption(RoadType.Ferry, R.string.avoid_ferry),
|
||||
new DrivingOption(RoadType.Motorway, R.string.avoid_motorways)};
|
||||
new DrivingOption(RoadType.Motorway, R.string.avoid_motorways),
|
||||
new DrivingOption(RoadType.Steps, R.string.avoid_steps)};
|
||||
|
||||
@NonNull
|
||||
private final Map<RoadType, Boolean> mInitialDrivingOptionsState = new HashMap<>();
|
||||
|
||||
@@ -107,6 +107,11 @@ public class DrivingOptionsFragment extends BaseMwmToolbarFragment
|
||||
dirtyRoadsBtn.setChecked(RoutingOptions.hasOption(RoadType.Dirty));
|
||||
CompoundButton.OnCheckedChangeListener dirtyBtnListener = new ToggleRoutingOptionListener(RoadType.Dirty);
|
||||
dirtyRoadsBtn.setOnCheckedChangeListener(dirtyBtnListener);
|
||||
|
||||
SwitchCompat stepsBtn = root.findViewById(R.id.avoid_steps_btn);
|
||||
stepsBtn.setChecked(RoutingOptions.hasOption(RoadType.Steps));
|
||||
CompoundButton.OnCheckedChangeListener stepsBtnListener = new ToggleRoutingOptionListener(RoadType.Steps);
|
||||
stepsBtn.setOnCheckedChangeListener(stepsBtnListener);
|
||||
}
|
||||
|
||||
private static class ToggleRoutingOptionListener implements CompoundButton.OnCheckedChangeListener
|
||||
|
||||
Reference in New Issue
Block a user