Пример #1
0
 @Override
 public void onClick(View v) {
   switch (v.getId()) {
     case R.id.cutbefore:
       // application.editingTrack.cutBefore(trackBar.getProgress());
       int nb = application.editingTrack.getAllPoints().size() - 1;
       trackBar.setMax(nb);
       trackBar.setProgress(0);
       break;
     case R.id.cutafter:
       // application.editingTrack.cutAfter(trackBar.getProgress());
       int na = application.editingTrack.getAllPoints().size() - 1;
       trackBar.setMax(na);
       trackBar.setProgress(0);
       trackBar.setProgress(na);
       break;
     case R.id.finishtrackedit:
       application.editingTrack.editing = false;
       application.editingTrack.editingPos = -1;
       application.editingTrack = null;
       //				findViewById(R.id.edittrack).setVisibility(View.GONE);
       //				findViewById(R.id.trackdetails).setVisibility(View.GONE);
       // updateGPSStatus();
       if (showDistance == 2) {
         application.overlayManager.distanceOverlay.setEnabled(true);
       }
       map.setFocusable(true);
       map.setFocusableInTouchMode(true);
       map.requestFocus();
       break;
   }
 }
Пример #2
0
 private void startEditTrack(Track track) {
   setFollowing(false);
   application.editingTrack = track;
   application.editingTrack.editing = true;
   int n = application.editingTrack.getAllPoints().size() - 1;
   int p = application.editingTrack.editingPos >= 0 ? application.editingTrack.editingPos : n;
   application.editingTrack.editingPos = p;
   trackBar.setMax(n);
   trackBar.setProgress(0);
   trackBar.setProgress(p);
   trackBar.setKeyProgressIncrement(1);
   onProgressChanged(trackBar, p, false);
   //		findViewById(R.id.edittrack).setVisibility(View.VISIBLE);
   //		findViewById(R.id.trackdetails).setVisibility(View.VISIBLE);
   // updateGPSStatus();
   if (showDistance > 0) application.overlayManager.distanceOverlay.setEnabled(false);
   map.setFocusable(false);
   map.setFocusableInTouchMode(false);
   trackBar.requestFocus();
   // updateMapViewArea();
 }