public void start() { mLogger.d("start"); if (!MapObject.isOfType(MapObject.MY_POSITION, mStartPoint)) { Statistics.INSTANCE.trackEvent(Statistics.EventName.ROUTING_START_SUGGEST_REBUILD); AlohaHelper.logClick(AlohaHelper.ROUTING_START_SUGGEST_REBUILD); suggestRebuildRoute(); return; } MapObject my = LocationHelper.INSTANCE.getMyPosition(); if (my == null) { mRoutingListener.onRoutingEvent(ResultCodesHelper.NO_POSITION, null); return; } mStartPoint = my; Statistics.INSTANCE.trackEvent(Statistics.EventName.ROUTING_START); AlohaHelper.logClick(AlohaHelper.ROUTING_START); setState(State.NAVIGATION); mContainer.showRoutePlan(false, null); mContainer.showNavigation(true); ThemeSwitcher.restart(); Framework.nativeFollowRoute(); LocationHelper.INSTANCE.restart(); }
@MainThread public void restore() { mHasContainerSavedState = false; if (isPlanning()) showRoutePlan(); if (mContainer != null) { if (isUberPlanning()) mContainer.updateBuildProgress(0, mLastRouterType); mContainer.showNavigation(isNavigating()); mContainer.updateMenu(); mContainer.updatePoints(); } processRoutingEvent(); }
public boolean cancel() { if (isPlanning()) { mLogger.d("cancel: planning"); cancelInternal(); if (mContainer != null) mContainer.showRoutePlan(false, null); return true; } if (isNavigating()) { mLogger.d("cancel: navigating"); cancelInternal(); if (mContainer != null) { mContainer.showNavigation(false); mContainer.updateMenu(); } return true; } mLogger.d("cancel: none"); return false; }