From cd3697863e1927bc9effaf6cd009e80aeb721669 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 12 Jun 2016 23:34:37 +0200 Subject: [PATCH] use a different axis to determing if we are in landscape --- .../java/com/simplemobiletools/camera/MainActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/camera/MainActivity.java b/app/src/main/java/com/simplemobiletools/camera/MainActivity.java index d041ba6a..abc5e5cd 100644 --- a/app/src/main/java/com/simplemobiletools/camera/MainActivity.java +++ b/app/src/main/java/com/simplemobiletools/camera/MainActivity.java @@ -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; } }