Implement normal keycode left/up...

This commit is contained in:
Victor Shcherb 2012-07-31 01:25:11 +02:00
parent e10b3f3826
commit 959d05661e
2 changed files with 9 additions and 1 deletions

View file

@ -492,7 +492,7 @@ public class OsmandSettings {
// this value string is synchronized with settings_pref.xml preference name
public final OsmandPreference<Boolean> ZOOM_BY_TRACKBALL =
new BooleanAccessibilityPreference("zoom_by_trackball", true).makeGlobal();
new BooleanAccessibilityPreference("zoom_by_trackball", false).makeGlobal();
// this value string is synchronized with settings_pref.xml preference name
public final OsmandPreference<Boolean> SCROLL_MAP_BY_GESTURES =

View file

@ -1123,6 +1123,14 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
changeZoom(mapView.getZoom() + 1);
return true;
}
} else if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT ||
keyCode == KeyEvent.KEYCODE_DPAD_RIGHT ||keyCode == KeyEvent.KEYCODE_DPAD_DOWN ||
keyCode == KeyEvent.KEYCODE_DPAD_UP) {
int dx = keyCode == KeyEvent.KEYCODE_DPAD_RIGHT ? 15 : (keyCode == KeyEvent.KEYCODE_DPAD_LEFT ? - 15 : 0);
int dy = keyCode == KeyEvent.KEYCODE_DPAD_DOWN ? 15 : (keyCode == KeyEvent.KEYCODE_DPAD_UP ? -15 : 0);
LatLon l = mapView.getLatLonFromScreenPoint(mapView.getCenterPointX() + dx, mapView.getCenterPointY() + dy);
setMapLocation(l.getLatitude(), l.getLongitude());
return true;
}
return super.onKeyUp(keyCode,event);
}