mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-03 14:49:22 +00:00
Android: fix landscape lock
If emulation started in landscape then it wouldn't lock to landscape, thus allowing a rotation to portrait then immediately back to landscape. Also locking to landscape didn't need to be called from another thread, so that was removed as well
This commit is contained in:
parent
5508082345
commit
b7d0b27a8c
1 changed files with 7 additions and 11 deletions
|
@ -211,18 +211,14 @@ public final class EmulationActivity extends AppCompatActivity
|
||||||
|
|
||||||
int themeId;
|
int themeId;
|
||||||
if (mDeviceHasTouchScreen)
|
if (mDeviceHasTouchScreen)
|
||||||
{
|
|
||||||
// Force landscape
|
|
||||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT)
|
|
||||||
{
|
{
|
||||||
BooleanSetting lockLandscape =
|
BooleanSetting lockLandscape =
|
||||||
(BooleanSetting) mSettings.getSection(Settings.SECTION_INI_CORE)
|
(BooleanSetting) mSettings.getSection(Settings.SECTION_INI_CORE)
|
||||||
.getSetting(SettingsFile.KEY_LOCK_LANDSCAPE);
|
.getSetting(SettingsFile.KEY_LOCK_LANDSCAPE);
|
||||||
|
// Force landscape if set
|
||||||
if (lockLandscape == null || lockLandscape.getValue())
|
if (lockLandscape == null || lockLandscape.getValue())
|
||||||
new Handler().postDelayed(
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
|
||||||
() -> setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE),
|
|
||||||
100);
|
|
||||||
}
|
|
||||||
themeId = R.style.DolphinEmulationBase;
|
themeId = R.style.DolphinEmulationBase;
|
||||||
|
|
||||||
// Get a handle to the Window containing the UI.
|
// Get a handle to the Window containing the UI.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue