Exemple #1
0
  private void build() {
    mLogger.d("build");
    mUberRequestHandled = false;
    mLastBuildProgress = 0;
    mInternetConnected = ConnectionState.isConnected();

    if (mLastRouterType == Framework.ROUTER_TYPE_TAXI) {
      if (!mInternetConnected) {
        completeUberRequest();
        return;
      }
      requestUberInfo();
    }

    setBuildState(BuildState.BUILDING);
    updatePlan();

    Statistics.INSTANCE.trackRouteBuild(mLastRouterType, mStartPoint, mEndPoint);
    org.alohalytics.Statistics.logEvent(
        AlohaHelper.ROUTING_BUILD,
        new String[] {
          Statistics.EventParam.FROM, Statistics.getPointType(mStartPoint),
          Statistics.EventParam.TO, Statistics.getPointType(mEndPoint)
        });
    Framework.nativeBuildRoute(
        mStartPoint.getLat(), mStartPoint.getLon(), mEndPoint.getLat(), mEndPoint.getLon());
  }
Exemple #2
0
  private void cancelInternal() {
    mLogger.d("cancelInternal");

    mStartPoint = null;
    mEndPoint = null;
    setPointsInternal();
    mWaitingPoiPickSlot = NO_SLOT;
    mUberRequestHandled = false;

    setBuildState(BuildState.NONE);
    setState(State.NONE);

    ThemeSwitcher.restart();
    Framework.nativeCloseRouting();
    LocationHelper.INSTANCE.restart();
  }
Exemple #3
0
  private void processRoutingEvent() {
    if (!mContainsCachedResult || mContainer == null || mHasContainerSavedState) return;

    mContainsCachedResult = false;

    if (mLastResultCode == ResultCodesHelper.NO_ERROR) {
      updatePlan();
      return;
    }

    setBuildState(BuildState.ERROR);
    mLastBuildProgress = 0;
    updateProgress();

    RoutingErrorDialogFragment fragment =
        RoutingErrorDialogFragment.create(mLastResultCode, mLastMissingMaps);
    fragment.show(
        mContainer.getActivity().getSupportFragmentManager(),
        RoutingErrorDialogFragment.class.getSimpleName());
  }