Add check for changing route calculation in progress

This commit is contained in:
Chumva 2019-03-20 15:42:48 +02:00
parent 731b1ca1fe
commit 42da5aabce
2 changed files with 7 additions and 6 deletions

View file

@ -405,11 +405,12 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
OsmandApplication app = getApp(); OsmandApplication app = getApp();
if (app != null && fragmentRef != null && fragment.isVisible()) { if (app != null && fragmentRef != null && fragment.isVisible()) {
boolean routeCalculating = app.getRoutingHelper().isRouteBeingCalculated() || app.getTransportRoutingHelper().isRouteBeingCalculated(); boolean routeCalculating = app.getRoutingHelper().isRouteBeingCalculated() || app.getTransportRoutingHelper().isRouteBeingCalculated();
setRouteCalculationInProgress(routeCalculating); if (setRouteCalculationInProgress(routeCalculating)) {
if (!routeCalculationInProgress) {
fragment.hideRouteCalculationProgressBar(); fragment.hideRouteCalculationProgressBar();
}
fragment.updateControlButtons(); fragment.updateControlButtons();
fragment.updateInfo(); fragment.updateInfo();
if (!menuCards.isEmpty() && currentMenuState == MenuState.HEADER_ONLY) {
fragment.openMenuHalfScreen(); fragment.openMenuHalfScreen();
} }
} }

View file

@ -1,12 +1,12 @@
package net.osmand.plus.routing; package net.osmand.plus.routing;
import net.osmand.GPXUtilities.GPXFile;
import net.osmand.Location; import net.osmand.Location;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.ValueHolder; import net.osmand.ValueHolder;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.plus.ApplicationMode; import net.osmand.plus.ApplicationMode;
import net.osmand.GPXUtilities.GPXFile;
import net.osmand.plus.NavigationService; import net.osmand.plus.NavigationService;
import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;