|
| 1 | +diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java |
| 2 | +index 2d7d69b76a25..edb42fb55461 100644 |
| 3 | +--- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java |
| 4 | ++++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java |
| 5 | +@@ -971,15 +971,18 @@ public void setOrientationBis(int w, int h, boolean resizable, String hint) |
| 6 | + /* If set, hint "explicitly controls which UI orientations are allowed". */ |
| 7 | + if (hint.contains("LandscapeRight") && hint.contains("LandscapeLeft")) { |
| 8 | + orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE; |
| 9 | +- } else if (hint.contains("LandscapeRight")) { |
| 10 | +- orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE; |
| 11 | + } else if (hint.contains("LandscapeLeft")) { |
| 12 | ++ orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE; |
| 13 | ++ } else if (hint.contains("LandscapeRight")) { |
| 14 | + orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE; |
| 15 | + } |
| 16 | + |
| 17 | +- if (hint.contains("Portrait") && hint.contains("PortraitUpsideDown")) { |
| 18 | ++ /* exact match to 'Portrait' to distinguish with PortraitUpsideDown */ |
| 19 | ++ boolean contains_Portrait = hint.contains("Portrait ") || hint.endsWith("Portrait"); |
| 20 | ++ |
| 21 | ++ if (contains_Portrait && hint.contains("PortraitUpsideDown")) { |
| 22 | + orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT; |
| 23 | +- } else if (hint.contains("Portrait")) { |
| 24 | ++ } else if (contains_Portrait) { |
| 25 | + orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; |
| 26 | + } else if (hint.contains("PortraitUpsideDown")) { |
| 27 | + orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT; |
0 commit comments