From 8fadbd96f8a21a9692aa2c10abece8fb1f71b377 Mon Sep 17 00:00:00 2001 From: Roman Romanov Date: Wed, 5 Jul 2017 11:02:14 +0400 Subject: [PATCH] [android] return to planing state from navigating state if add/remove stop --- .../maps/routing/RoutingController.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/android/src/com/mapswithme/maps/routing/RoutingController.java b/android/src/com/mapswithme/maps/routing/RoutingController.java index 6171b5b0ea..3557f9ff6c 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingController.java @@ -442,6 +442,8 @@ public class RoutingController implements TaxiManager.TaxiListener build(); if (mContainer != null) mContainer.onAddedStop(); + + backToPlaningStateIfNavigating(); } public void removeStop(@NonNull MapObject mapObject) @@ -458,6 +460,23 @@ public class RoutingController implements TaxiManager.TaxiListener build(); if (mContainer != null) mContainer.onRemovedStop(); + + backToPlaningStateIfNavigating(); + } + + private void backToPlaningStateIfNavigating() + { + if (!isNavigating()) + return; + + setState(State.PREPARE); + if (mContainer != null) + { + mContainer.showNavigation(false); + mContainer.showRoutePlan(true, null); + mContainer.updateMenu(); + mContainer.onNavigationCancelled(); + } } public void removeIntermediatePoints()