Android: orientation, check for exact match to "Portrait". (see #6959)
(Portrait is also contained in PortraitUpsideDown)main
parent
c4982955b2
commit
4408e9f957
|
@ -977,9 +977,12 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||||
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
|
orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hint.contains("Portrait") && hint.contains("PortraitUpsideDown")) {
|
/* exact match to 'Portrait' to distinguish with PortraitUpsideDown */
|
||||||
|
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_SENSOR_PORTRAIT;
|
||||||
} else if (hint.contains("Portrait")) {
|
} else if (contains_Portrait) {
|
||||||
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
||||||
} else if (hint.contains("PortraitUpsideDown")) {
|
} else if (hint.contains("PortraitUpsideDown")) {
|
||||||
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
|
orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
|
||||||
|
|
Loading…
Reference in New Issue