Fix route recalculation for public transport

This commit is contained in:
Chumva 2019-03-28 17:23:00 +02:00
parent 1786bd235f
commit 992c675806
2 changed files with 3 additions and 12 deletions

View file

@ -302,11 +302,7 @@ public class AvoidRoadsBottomSheetDialogFragment extends MenuBottomSheetDialogFr
avoidSpecificRoads.removeImpassableRoad(routeLocation);
}
RoutingHelper routingHelper = app.getRoutingHelper();
if (routingHelper.isRouteCalculated() || routingHelper.isRouteBeingCalculated()) {
routingHelper.recalculateRouteDueToSettingsChange();
}
app.getRoutingHelper().recalculateRouteDueToSettingsChange();
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
final MapRouteInfoMenu mapRouteInfoMenu = mapActivity.getMapRouteInfoMenu();

View file

@ -1069,9 +1069,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
if (routeDataObject != null) {
app.getAvoidSpecificRoads().removeImpassableRoad(routeDataObject);
}
if (routingHelper.isRouteCalculated() || routingHelper.isRouteBeingCalculated()) {
routingHelper.recalculateRouteDueToSettingsChange();
}
routingHelper.recalculateRouteDueToSettingsChange();
if (app.getAvoidSpecificRoads().getImpassableRoads().isEmpty() && getAvoidedParameters(app).isEmpty()) {
mode.parameters.remove(parameter);
}
@ -1104,10 +1102,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
CommonPreference<Boolean> preference = settings.getCustomRoutingBooleanProperty(routingParameter.getId(), routingParameter.getDefaultBoolean());
preference.setModeValue(app.getRoutingHelper().getAppMode(), false);
avoidedParameters.remove(routingParameter);
RoutingHelper routingHelper = app.getRoutingHelper();
if (routingHelper.isRouteCalculated() || routingHelper.isRouteBeingCalculated()) {
routingHelper.recalculateRouteDueToSettingsChange();
}
app.getRoutingHelper().recalculateRouteDueToSettingsChange();
if (app.getAvoidSpecificRoads().getImpassableRoads().isEmpty() && avoidedParameters.isEmpty()) {
mode.parameters.remove(parameter);
}