예제 #1
0
 @Override
 public void onSnapLocation(Location originalLocation, Location snapLocation) {
   storeLocationInfo(originalLocation, snapLocation);
   manageMap(originalLocation, snapLocation);
   debugView.setCurrentLocation(originalLocation);
   debugView.setSnapLocation(snapLocation);
   debugView.setAverageSpeed(getAverageSpeed());
   logForDebugging(originalLocation, snapLocation);
 }
예제 #2
0
 private void showInstruction(int index) {
   if (isPaging) {
     final Instruction instruction = instructions.get(index);
     pagerPositionWhenPaused = index;
     Logger.logToDatabase(act, db, ROUTE_TAG, "paging to instruction: " + instruction.toString());
     pager.setCurrentItem(index);
     debugView.setClosestInstruction(instruction);
   } else {
     pagerPositionWhenPaused = index;
   }
 }
예제 #3
0
  @Override
  public void onUpdateDistance(int distanceToNextInstruction, int distanceToDestination) {
    debugView.setClosestDistance(route.getCurrentInstruction().getLiveDistanceToNext());
    this.distanceToDestination.setDistance(distanceToDestination);
    this.distanceToDestination.setVisibility(View.VISIBLE);

    final View view = getPagerViewForIndex(pagerPositionWhenPaused);
    if (view != null) {
      final TextView currentInstructionDistance =
          (TextView) view.findViewById(R.id.distance_instruction);
      currentInstructionDistance.setText(
          DistanceFormatter.format(route.getCurrentInstruction().getLiveDistanceToNext(), true));
    }
  }
예제 #4
0
 private void initDebugView(View view) {
   debugView = (DebugView) view.findViewById(R.id.debugging);
   if (act.isInDebugMode()) {
     debugView.setVisibility(View.VISIBLE);
   }
 }