Skip to content

Commit 14a9348

Browse files
Oxdeceptioncharlesisfeline
Oxdeception
authored andcommitted
Android: Use SCREEN_ORIENTATION_FULL_USER instead of SCREEN_ORIENTATION_FULL_SENSOR For Resizable Window.
Fixes openfl#1737 Pulled from libsdl-org/SDL#10046
1 parent 63c64b0 commit 14a9348

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

templates/android/template/app/src/main/java/org/libsdl/app/SDLActivity.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -965,8 +965,8 @@ public void setOrientationBis(int w, int h, boolean resizable, String hint)
965965
/* No valid hint, nothing is explicitly allowed */
966966
if (!is_portrait_allowed && !is_landscape_allowed) {
967967
if (resizable) {
968-
/* All orientations are allowed */
969-
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
968+
/* All orientations are allowed, respecting user orientation lock setting */
969+
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
970970
} else {
971971
/* Fixed window and nothing specified. Get orientation from w/h of created window */
972972
req = (w > h ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
@@ -975,8 +975,8 @@ public void setOrientationBis(int w, int h, boolean resizable, String hint)
975975
/* At least one orientation is allowed */
976976
if (resizable) {
977977
if (is_portrait_allowed && is_landscape_allowed) {
978-
/* hint allows both landscape and portrait, promote to full sensor */
979-
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
978+
/* hint allows both landscape and portrait, promote to full user */
979+
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
980980
} else {
981981
/* Use the only one allowed "orientation" */
982982
req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);

0 commit comments

Comments
 (0)