An option to lock changing orientation on Android

Got a cool idea that should be in R'n'D? Let's hear it!

Moderators: Flumminator, Zomis

Post Reply
mat
Posts: 61
Joined: Sun Sep 20, 2020 8:24 am

An option to lock changing orientation on Android

Post by mat »

It would be nice to see that feature as I would not like my phone to change the orientation when I turn my device just a little.
User avatar
Eizzoux
Posts: 567
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Re: An option to lock changing orientation on Android

Post by Eizzoux »

I feel like it would be better if R'n'D was just in album orientation by default. Or, at least if it had more height than width, then it would be locked to portrait orientation, and when opposite, then album (depending on the levelset viewport)
𒈟
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: An option to lock changing orientation on Android

Post by Holger »

I indeed thought about it, but then decided against it, because on larger tablets it can be nice to play in portrait mode, to have the screen controls at the bottom of the screen, not overlapping with the playfield. This is especially true for the nearly square default R'n'D artwork.

If you want to lock the screen orientation, why not simply use the easily accessible option from the Android system menu that slides in from the top of the screen on any recent Android device?
mat
Posts: 61
Joined: Sun Sep 20, 2020 8:24 am

Re: An option to lock changing orientation on Android

Post by mat »

Holger wrote: Wed Jun 08, 2022 1:33 pm f you want to lock the screen orientation, why not simply use the easily accessible option from the Android system menu that slides in from the top of the screen on any recent Android device?
Unfortunately, the Android lock doesn't work with R'n'D. It turns the screen anyway.
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: An option to lock changing orientation on Android

Post by Holger »

Unfortunately, the Android lock doesn't work with R'n'D. It turns the screen anyway.
Indeed! :shock:

I could have sworn that worked once... will have to check the settings in R'n'D's "Manifest" file!
User avatar
Eizzoux
Posts: 567
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Re: An option to lock changing orientation on Android

Post by Eizzoux »

Holger wrote: Wed Jun 08, 2022 2:02 pm
Unfortunately, the Android lock doesn't work with R'n'D. It turns the screen anyway.
Indeed! :shock:

I could have sworn that worked once... will have to check the settings in R'n'D's "Manifest" file!
Yeah, that indeed worked before, like, around a decade o' versions ago, except it had an issue with turning the portrait mode despite the screen orientation I had before locking. Whether I had it vertical or horizontal, after locking it was just going vertical as soon as I lock rotation anyways.
𒈟
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: An option to lock changing orientation on Android

Post by filbo »

There are endless issues with the 'easy to use' orientation switch in Android. It really would be better for the game to have its own control.

The version of Android I'm using has a setting where orientation doesn't automatically change when rotated; instead, a little symbol appears in the corner, which changes the orientation if you touch it. BUT. Some apps in full screen mode manage to hide that symbol. And the symbol doesn't necessarily appear for long enough to get at it, so I often end up moving back to the original (physical) orientation, then back to the desired one, to re-invoke the symbol.

When that symbol isn't there, nothing is in that little corner slot. I wish it would simply always have a 'change orientation' button there, without the slightest regard to current physical or logical orientation, nor what rotations I've been doing recently.

So, RnD should have one of those. Perhaps in that place (lower right hand corner of portrait mode = lower left corner of landscape, or upper right of other-way landscape). Or perhaps in its own unique place, less likely to clash with a possible native widget. For a purposeful widget like that, I also recommend that it either require a double-tap or a long-hold: so that a simple mistaken brush of the screen doesn't suddenly change orientation, which is rather disruptive.
sokoban
Posts: 12
Joined: Sun Jan 14, 2007 7:37 am

Re: An option to lock changing orientation on Android

Post by sokoban »

Any word on fixing this issues?

It is incredible annoying to try play the game in bed

Android 13, MIUI 14.
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: An option to lock changing orientation on Android

Post by Holger »

It is incredible annoying to try play the game in bed
Good point! :-D

And thanks for bringing this topic to my attention again.

I did some more tests and found out that there is no way to control the desired behavior(*) using the Android Manifest file (where I thought it would belong to). Instead, it seems that I have to directly patch the file "SDLActivity.java" that comes with the SDL Android project stub (and about which I thought that it would not have to be adjusted at all for building an SDL based Android app -- but which I already had to patch in the past when automatic screen rotation suddenly stopped with some SDL version years ago). The code for screen rotation in that file (that prevents respecting the user's device setting for locking screen rotation) apparently is still the same as that of the latest SDL version, and in fact I consider this a bug that should be fixed in the SDL library's Android project code.

(*) Regarding "desired behavior" of screen rotation: In my opinion, the R'n'D screen should follow the current screen rotation if locked screen rotation is turned off, and should stay with the locked screen orientation if locked screen rotation is turned on. I really hesitate to add an option into R'n'D itself to control the desired screen orientation, as I am convinced that this should be a device setting that should be followed by R'n'D (just as by any other app that supports different screen orientations). Just imagine the mess that would be caused by each app bringing its own custom buttons and widgets for screen rotation, polluting the screen to do something that should be done by the user interface settings and not the app itself.

I have tested my patch and it seems that it works as it should now. :)

The change will most probably be released very soon with the next patch release.
Post Reply