From 7320798931a2703da46695b5d556de547948c987 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 5 Nov 2017 11:38:54 +0100 Subject: [PATCH] make switching to landscape less sensitive --- .../camera/activities/MainActivity.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt index 53607601..13dc6daa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt @@ -497,12 +497,10 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave return } - val currOrient = if (orientation in 45..134) { - ORIENT_LANDSCAPE_RIGHT - } else if (orientation in 225..314) { - ORIENT_LANDSCAPE_LEFT - } else { - ORIENT_PORTRAIT + val currOrient = when (orientation) { + in 75..134 -> ORIENT_LANDSCAPE_RIGHT + in 225..289 -> ORIENT_LANDSCAPE_LEFT + else -> ORIENT_PORTRAIT } if (currOrient != mLastHandledOrientation) {