예제 #1
0
  public void update(RoutingInfo info) {
    if (info == null) return;

    if (Framework.nativeGetRouter() == Framework.ROUTER_TYPE_VEHICLE) updateVehicle(info);
    else updatePedestrian(info);

    mTimeTotal.setText(
        RoutingController.formatRoutingTime(
            info.totalTimeInSeconds, R.dimen.text_size_routing_dimension));
    mDistanceTotal.setText(
        Utils.formatUnitsText(
            R.dimen.text_size_routing_number, R.dimen.text_size_routing_dimension,
            info.distToTarget, info.targetUnits));
    mTimeArrival.setText(RoutingController.formatArrivalTime(info.totalTimeInSeconds));
    UiUtils.setTextAndHideIfEmpty(mNextStreet, info.nextStreet);
    mRouteProgress.setProgress((int) info.completionPercent);
  }
  @Override
  public void onDismiss(DialogInterface dialog) {
    if (mCancelled && mCancelRoute) RoutingController.get().cancel();

    super.onDismiss(dialog);
  }
예제 #3
0
 @Override
 public boolean onBackPressed() {
   return RoutingController.get().cancelPlanning();
 }
예제 #4
0
  public void updateNorth(double north) {
    if (!RoutingController.get().isNavigating()) return;

    mNorth = north;
    update(Framework.nativeGetRouteFollowingInfo());
  }