mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
Add sensor-based screen orientation for Android (#2056)
* Adding sensor-based orientation for Android * Fix indents broken by NotePad++
This commit is contained in:
parent
320a595711
commit
6aad1923cb
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue