Respect Android's auto-rotate setting when choosing orientation

This commit is contained in:
Anthony 2024-07-27 17:10:35 +01:00 committed by Sam Lantinga
parent 9da58e9fb7
commit 7cd23bfb6a

View File

@ -1107,7 +1107,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
/* If set, hint "explicitly controls which UI orientations are allowed". */
if (hint.contains("LandscapeRight") && hint.contains("LandscapeLeft")) {
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE;
} else if (hint.contains("LandscapeLeft")) {
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
} else if (hint.contains("LandscapeRight")) {
@ -1118,7 +1118,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
boolean contains_Portrait = hint.contains("Portrait ") || hint.endsWith("Portrait");
if (contains_Portrait && hint.contains("PortraitUpsideDown")) {
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT;
} else if (contains_Portrait) {
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
} else if (hint.contains("PortraitUpsideDown")) {