mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
use a different axis to determing if we are in landscape
This commit is contained in:
@ -213,14 +213,14 @@ public class MainActivity extends AppCompatActivity implements SensorEventListen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSensorChanged(SensorEvent event) {
|
public void onSensorChanged(SensorEvent event) {
|
||||||
if (event.values[1] < 6.5 && event.values[1] > -6.5) {
|
if (event.values[0] < 6.5 && event.values[0] > -6.5) {
|
||||||
|
orientation = Constants.ORIENT_PORTRAIT;
|
||||||
|
} else {
|
||||||
if (event.values[0] > 0) {
|
if (event.values[0] > 0) {
|
||||||
orientation = Constants.ORIENT_LANDSCAPE_LEFT;
|
orientation = Constants.ORIENT_LANDSCAPE_LEFT;
|
||||||
} else {
|
} else {
|
||||||
orientation = Constants.ORIENT_LANDSCAPE_RIGHT;
|
orientation = Constants.ORIENT_LANDSCAPE_RIGHT;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
orientation = Constants.ORIENT_PORTRAIT;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user