Issue 426:Zooming with volume buttons if it is not following mode

This commit is contained in:
Victor Shcherb 2011-07-13 00:15:45 +02:00
parent ea967b722b
commit d8d65ab5ea

View file

@ -387,7 +387,19 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(newIntent);
return true;
}
} else if (!routingHelper.isFollowingMode()) {
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP && event.getRepeatCount() == 0) {
if (mapView.isZooming()) {
changeZoom(mapView.getZoom() + 2);
} else {
changeZoom(mapView.getZoom() + 1);
}
return true;
} else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN && event.getRepeatCount() == 0) {
changeZoom(mapView.getZoom() - 1);
return true;
}
}
return super.onKeyDown(keyCode, event);
}
@Override