-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android sensor_portrait not working #39266
Comments
To add to this, "sensor" does rotate to all directions but does not respect the user's Android lock rotation setting (rotates even if locked) According to developer.android.com, the "fullUser" setting seems to respect lock: "fullUser" | If the user has locked sensor-based rotation, this behaves the same as user, otherwise it behaves the same as fullSensor and allows any of the 4 possible screen orientations. Added in API level 18. Also, the ability to change resizeableActivity to true would be great for split screen and android desktop mode. (I don't think we have the ability currently in Android export options) |
The fix for this should be easy, but while looking into the bug, I found out there are two non-compatible ways to set the app orientation:
Option So going forward, I'll update the logic to use the process used by option |
I've been asking @pouleyKetchoupp for help on this, and we found a fix, using option 1. I think option 1 would be more user friendly because then the iOS and android orientation setting would be unified (vs having to set it twice in 2 different places for iOS and android) if it's possible I'd like to make this change (replacing sensor with fullUser on android), I've never contributed to a software project before! Only this part: |
@HEAVYPOLY Sounds good to me, and I'd be happy to help if you have questions! Though the change will involve more than |
Concerning the two settings for orientation: For the sensor taking user choice into account: |
@pouleyKetchoupp Yes seems like using orientation from project settings is the way to go, with the logic being updated to update the |
@pouleyKetchoupp I agree that "sensor" behavior should be fullUser to match iOS "sensor" behavior and a new option like "force-sensor" or "sensor-ignore-lock" would be added for the current android behavior. |
@HEAVYPOLY It sounds good to make it consistent with iOS (and the new option would fall back to sensor on iOS I guess). This would work well for 4.0. If it's backported to 3.2 though, maybe the current behavior needs to be kept on Android to avoid compatibility breakage (it's hard to decide what expected behavior is in this case). |
@pouleyKetchoupp I think we should be fine on the backward compatibility front. There would be issues if we're changing values from |
@m4gr3d For backward compatibility I was thinking more about changing the current |
@m4gr3d : @HEAVYPOLY has made good progress on the PR, but after hitting some issues with updating the AndroidManifest in custom build and checking the code again, I wonder if it's the right direction to go because:
So my question is: could we make this change easier by just removing the orientation option in export settings, not bother fixing the orientation in the android manifest at all during export, and just keep setting it when the application starts? Or is there a specific reason why it needs to be done in the android manifest? |
My first PR! |
@HEAVYPOLY Nice job!! I was leaning toward the
I think a hybrid approach should address both need:
@HEAVYPOLY I can tackle the second task as I'll also be doing some cleanups to fix up some AAB issues in the export logic. |
Godot version:
3.2.1-stable-official
OS/device including version:
GLES2 project - Samsung A30 - Android 10
Issue description:
Setting "sensor_portrait" orientation on project settings does not work at all. Using "sensor" it does rotate to all directions.
Steps to reproduce:
Any android porject and use "sensor_portrait".
Minimal reproduction project:
The text was updated successfully, but these errors were encountered: