From 6aad1923cbe90eeee8a65c29147efc14b0cb01be Mon Sep 17 00:00:00 2001 From: Certainty Witch Date: Tue, 4 May 2021 19:26:00 +0200 Subject: [PATCH] Add sensor-based screen orientation for Android (#2056) * Adding sensor-based orientation for Android * Fix indents broken by NotePad++ --- .../java/com/github/stenzek/duckstation/EmulationActivity.java | 2 ++ android/app/src/main/res/values/arrays.xml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/android/app/src/main/java/com/github/stenzek/duckstation/EmulationActivity.java b/android/app/src/main/java/com/github/stenzek/duckstation/EmulationActivity.java index 9ea85bc93..4c14f5a86 100644 --- a/android/app/src/main/java/com/github/stenzek/duckstation/EmulationActivity.java +++ b/android/app/src/main/java/com/github/stenzek/duckstation/EmulationActivity.java @@ -388,6 +388,8 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT); else if (orientation.equals("landscape")) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE); + else if (orientation.equals("sensor")) + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); else setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } diff --git a/android/app/src/main/res/values/arrays.xml b/android/app/src/main/res/values/arrays.xml index 49fa76d9e..a0f9d4811 100644 --- a/android/app/src/main/res/values/arrays.xml +++ b/android/app/src/main/res/values/arrays.xml @@ -404,11 +404,13 @@ Use Device Setting Portrait Landscape + Sensor Based unspecified portrait landscape + sensor Use Device Setting