import Sensor
This commit is contained in:
parent
ed95f35fdd
commit
8d639d4b63
2 changed files with 10 additions and 8 deletions
|
@ -51,6 +51,7 @@ import android.app.AlertDialog.Builder;
|
|||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorManager;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
|
@ -807,10 +808,10 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
}
|
||||
|
||||
//Looks like screenOrientation correction must not be applied for devices without compass?
|
||||
// Sensor s = ((SensorManager) getSystemService(Context.SENSOR_SERVICE)).getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
|
||||
// if (s == null) {
|
||||
// screenOrientation = 0;
|
||||
// }
|
||||
Sensor s = ((SensorManager) getSystemService(Context.SENSOR_SERVICE)).getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
|
||||
if (s == null) {
|
||||
screenOrientation = 0;
|
||||
}
|
||||
|
||||
draw.setAngle(mes[1] - a + 180 + screenOrientation);
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package net.osmand.plus.dashboard;
|
|||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorManager;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
@ -206,10 +207,10 @@ public class DashFavoritesFragment extends DashBaseFragment {
|
|||
}
|
||||
|
||||
//Looks like screenOrientation correction must not be applied for devices without compass?
|
||||
// Sensor s = ((SensorManager) getActivity().getSystemService(Context.SENSOR_SERVICE)).getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
|
||||
// if (s == null) {
|
||||
// screenOrientation = 0;
|
||||
// }
|
||||
Sensor s = ((SensorManager) getActivity().getSystemService(Context.SENSOR_SERVICE)).getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
|
||||
if (s == null) {
|
||||
screenOrientation = 0;
|
||||
}
|
||||
|
||||
draw.setAngle(mes[1] - a + 180 + screenOrientation);
|
||||
|
||||
|
|
Loading…
Reference in a new issue