Fix npe
This commit is contained in:
parent
d983309242
commit
684e5ddf15
1 changed files with 15 additions and 15 deletions
|
@ -406,23 +406,23 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
|
|||
}
|
||||
|
||||
public void switchRotateMapMode(){
|
||||
String rotMode = app.getString(R.string.rotate_map_none_opt);
|
||||
if (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_NONE && mapView.getRotate() != 0) {
|
||||
// reset manual rotation
|
||||
} else {
|
||||
int vl = (settings.ROTATE_MAP.get() + 1) % 3;
|
||||
settings.ROTATE_MAP.set(vl);
|
||||
if (mapView != null) {
|
||||
String rotMode = app.getString(R.string.rotate_map_none_opt);
|
||||
if (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_NONE && mapView.getRotate() != 0) {
|
||||
// reset manual rotation
|
||||
} else {
|
||||
int vl = (settings.ROTATE_MAP.get() + 1) % 3;
|
||||
settings.ROTATE_MAP.set(vl);
|
||||
|
||||
if (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING) {
|
||||
rotMode = app.getString(R.string.rotate_map_bearing_opt);
|
||||
} else if (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_COMPASS) {
|
||||
rotMode = app.getString(R.string.rotate_map_compass_opt);
|
||||
if (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING) {
|
||||
rotMode = app.getString(R.string.rotate_map_bearing_opt);
|
||||
} else if (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_COMPASS) {
|
||||
rotMode = app.getString(R.string.rotate_map_compass_opt);
|
||||
}
|
||||
}
|
||||
}
|
||||
rotMode = app.getString(R.string.rotate_map_to_bearing) + ":\n" + rotMode;
|
||||
app.showShortToastMessage(rotMode);
|
||||
updateSettings();
|
||||
if(mapView != null) {
|
||||
rotMode = app.getString(R.string.rotate_map_to_bearing) + ":\n" + rotMode;
|
||||
app.showShortToastMessage(rotMode);
|
||||
updateSettings();
|
||||
mapView.refreshMap();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue