Skip to content

Commit

Permalink
Merge pull request #7536 from zackhow/correct-landscape
Browse files Browse the repository at this point in the history
Android: fix landscape lock
  • Loading branch information
delroth committed Oct 31, 2018
2 parents 5508082 + b7d0b27 commit 22ddd11
Showing 1 changed file with 7 additions and 11 deletions.
Expand Up @@ -212,17 +212,13 @@ protected void onCreate(Bundle savedInstanceState)
int themeId;
if (mDeviceHasTouchScreen)
{
// Force landscape
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT)
{
BooleanSetting lockLandscape =
(BooleanSetting) mSettings.getSection(Settings.SECTION_INI_CORE)
.getSetting(SettingsFile.KEY_LOCK_LANDSCAPE);
if (lockLandscape == null || lockLandscape.getValue())
new Handler().postDelayed(
() -> setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE),
100);
}
BooleanSetting lockLandscape =
(BooleanSetting) mSettings.getSection(Settings.SECTION_INI_CORE)
.getSetting(SettingsFile.KEY_LOCK_LANDSCAPE);
// Force landscape if set
if (lockLandscape == null || lockLandscape.getValue())
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);

themeId = R.style.DolphinEmulationBase;

// Get a handle to the Window containing the UI.
Expand Down

0 comments on commit 22ddd11

Please sign in to comment.