@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); }
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; } }
@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)); } }
private void initDebugView(View view) { debugView = (DebugView) view.findViewById(R.id.debugging); if (act.isInDebugMode()) { debugView.setVisibility(View.VISIBLE); } }