/** @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem) */
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case 0:
       // Zoom in
       zoomIn();
       return true;
     case 1:
       // Zoom out
       zoomOut();
       return true;
     case 2:
       // Toggle satellite views
       mvMap.setSatellite(!mvMap.isSatellite());
       return true;
     case 3:
       // Toggle street views
       mvMap.setStreetView(!mvMap.isStreetView());
       return true;
     case 4:
       // Toggle traffic views
       mvMap.setTraffic(!mvMap.isTraffic());
       return true;
     case 5:
       // Show the job list activity
       startActivity(new Intent(MicroJobs.this, MicroJobsList.class));
       return true;
   }
   return false;
 }
Example #2
0
 public boolean onKeyDown(int keyCode, KeyEvent e) {
   if (keyCode == KeyEvent.KEYCODE_S) {
     mapView.setSatellite(!mapView.isSatellite());
     return true;
   } else if (keyCode == KeyEvent.KEYCODE_T) {
     mapView.setTraffic(!mapView.isTraffic());
     mapControl.animateTo(gp); // To ensure change displays immediately
   }
   return (super.onKeyDown(keyCode, e));
 }
Example #3
0
 @Override
 public boolean onKeyDown(int keyCode, KeyEvent event) { // click zoom key
   if (keyCode == KeyEvent.KEYCODE_S) {
     map.setSatellite(!map.isSatellite());
     return (true);
   } else if (keyCode == KeyEvent.KEYCODE_Z) {
     map.displayZoomControls(true);
     return (true);
   }
   return (super.onKeyDown(keyCode, event));
 }
Example #4
0
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   if (item.getItemId() == R.id.about) {
     Intent intent = new Intent(this, About.class);
     startActivity(intent);
   } else if (item.getItemId() == R.id.changeToSatellite) {
     if (map.isSatellite()) map.setSatellite(false);
     else map.setSatellite(true);
   }
   return true;
 }