mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-02-17 03:40:38 +01:00
use a different axis to determing if we are in landscape
This commit is contained in:
parent
00835946c6
commit
cd3697863e
@ -213,14 +213,14 @@ public class MainActivity extends AppCompatActivity implements SensorEventListen
|
||||
|
||||
@Override
|
||||
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) {
|
||||
orientation = Constants.ORIENT_LANDSCAPE_LEFT;
|
||||
} else {
|
||||
orientation = Constants.ORIENT_LANDSCAPE_RIGHT;
|
||||
}
|
||||
} else {
|
||||
orientation = Constants.ORIENT_PORTRAIT;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user