Add sensor-based screen orientation for Android (#2056)

* Adding sensor-based orientation for Android

* Fix indents broken by NotePad++
This commit is contained in:
Certainty Witch 2021-05-04 19:26:00 +02:00 committed by GitHub
parent 320a595711
commit 6aad1923cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -388,6 +388,8 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT);
else if (orientation.equals("landscape")) else if (orientation.equals("landscape"))
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE);
else if (orientation.equals("sensor"))
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
else else
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
} }

View file

@ -404,11 +404,13 @@
<item>Use Device Setting</item> <item>Use Device Setting</item>
<item>Portrait</item> <item>Portrait</item>
<item>Landscape</item> <item>Landscape</item>
<item>Sensor Based</item>
</string-array> </string-array>
<string-array name="settings_emulation_screen_orientation_values"> <string-array name="settings_emulation_screen_orientation_values">
<item>unspecified</item> <item>unspecified</item>
<item>portrait</item> <item>portrait</item>
<item>landscape</item> <item>landscape</item>
<item>sensor</item>
</string-array> </string-array>
<string-array name="settings_language_entries"> <string-array name="settings_language_entries">
<item>Use Device Setting</item> <item>Use Device Setting</item>