Skip to content
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

Lock screen orientation to landscape on mobile phones #16733

Merged
merged 5 commits into from
Feb 4, 2022

Conversation

Susko3
Copy link
Member

@Susko3 Susko3 commented Feb 1, 2022

Made after some thought in ppy/osu-framework#4897 (comment).
Relevant issue: #12764.

Why SensorLandscape was chosen over UserLandscape: https://github.com/ppy/osu-framework/pull/4897/files/bb55f2009a5ac2be489f91ab1537f8f2cdd54c0c#r759511353.

Landscape makes sense for osu! as it's primarily designed for landscape displays.

@peppy
Copy link
Member

peppy commented Feb 1, 2022

May need to consider tablets, where some users may want to run in portrait. On iOS at least, many applications are locked to landscape on phones but allow both orientations on tablets, where the difference between 4:3 vs 3:4 isn't that large.

Also vertical layout could be preferred for some use cases, like browsing overlays or chatting.

@Susko3
Copy link
Member Author

Susko3 commented Feb 1, 2022

We can't just change screen orientation when certain overlays are open, but maybe a toggle "Allow portrait during non-gameplay" (defaulting to disabled) could work.

I'm still a firm believer that the user should have more granular control (and one that applies to the whole game). Maybe not all options from the proposed config enum, but a select few. Showing different options for tablets and phones is also something to consider.

You do bring up a good point about chat. Using a virtual keyboard in landscape is bad UX on phones.

@bdach
Copy link
Collaborator

bdach commented Feb 1, 2022

i'm just going to mention that this was attempted before and rejected. see #10347 and subsequently #10348 which introduced the current fullUser orientation.

i'm not sure i have a clear opinion on this at this point.

@peppy
Copy link
Member

peppy commented Feb 2, 2022

At this point, I am willing to concede to limiting to landscape only on phones only if there's a majority of developers that sees this as the correct path forward. The edge cases where this is going to improve the user experience are limited to things like

  • Having a device flat on the desk and after orienting to landscape, the sensor misfiring and rotating back to portrait while the user is playing.
  • Playing the game while lying sideways.

Every other case should already be "automatically" handled correctly.

So I'm still not so sure, as I also intend osu! to be a utility app which can potentially be used to check on one's profile, chat, messages (even for PC-main players) and not strictly be about gameplay.

@smoogipoo thoughts on this?

@smoogipoo
Copy link
Contributor

I don't have an opinion on this because I don't have an Android phone.

@peppy
Copy link
Member

peppy commented Feb 2, 2022

It would also apply to iPhones if we made the change.

@smoogipoo
Copy link
Contributor

So all this means is that the default is landscape, but the user can change to portrait at any point, is that correct? Maybe I'm just not understanding the point of this.

@peppy
Copy link
Member

peppy commented Feb 2, 2022

The proposal is to lock the app to landscape permanently (allowing either orientation of landscape aka 180 degree rotation, but no portrait).

@frenzibyte frenzibyte changed the title Change default orientation to landscape on Android Lock screen orientation to landscape on Android Feb 2, 2022
@bdach
Copy link
Collaborator

bdach commented Feb 2, 2022

Given that the UI does not generally feel good in portrait yet, at least not on the screen sizes of devices I own (everything turns out being rather small, and designs are generally... designed for landscape - see song select) I would not be strongly opposed to always forcing landscape myself and eliminating that problem in a sense, at least for a little while. I don't feel that confident about it to just go and merge this myself though.

"Landscape Right" is often the proper default for landscape-only applications.

Matches up with all other landscape-only iOS games I have locally.
@pull-request-size pull-request-size bot added size/M and removed size/XS labels Feb 2, 2022
@frenzibyte frenzibyte changed the title Lock screen orientation to landscape on Android Lock screen orientation to landscape on mobile phones Feb 2, 2022
@frenzibyte
Copy link
Member

I have pushed a companion change for iPhones to keep consistency while this is being discussed (still keeping iPad to support all orientations using the special UISupportedInterfaceOrientations~ipad key).

@smoogipoo
Copy link
Contributor

Locking to landscape sounds fine for now.

@peppy
Copy link
Member

peppy commented Feb 3, 2022

@Susko3 is it possible to allow tablets to still run in portrait? not that it necessarily needs to be done if we apply this change, but am curious.

@peppy
Copy link
Member

peppy commented Feb 3, 2022

In addition, as everyone seems to agree I'm fine with pushing out this change, and revisiting at a point things behave better in portrait orientation on phones.

@Susko3
Copy link
Member Author

Susko3 commented Feb 3, 2022

@Susko3 is it possible to allow tablets to still run in portrait? not that it necessarily needs to be done if we apply this change, but am curious.

https://developer.android.com/guide/topics/large-screens/support-different-screen-sizes

Should be possible, but it's not a clear-cut IsTablet API, it involves calculating screen size.

We're probably going for ScreenOrientation.FullUser on tablets, to match iPads.

@peppy
Copy link
Member

peppy commented Feb 3, 2022

Basing the decision on the aspect ratio seems quite amicable if there's no standard. 4:3 would be a good cut-off I think.

@Susko3
Copy link
Member Author

Susko3 commented Feb 3, 2022

Have added a rudimentary tablet check, using 600 dp as recommended by the Android docs.

The activity no longer has a default screen orientation value, and will use the system default one while it's loading in.

I'll move this isTablet logic to framework at some point. But this will need to consider folding phones (which change display size), etc.

@peppy peppy merged commit 180d583 into ppy:master Feb 4, 2022
@Susko3 Susko3 deleted the android-orientation branch February 4, 2022 17:37
@smileyhead
Copy link

Just pitching in a comment, but I feel like that portrait would definitely be preferred on Mania (whenever touch support gets implemented), and possibly CtB, too.

@Susko3
Copy link
Member Author

Susko3 commented Feb 6, 2022

I mentioned something similar here #12764 (comment).
Please keep all comments in that thread.

@frenzibyte
Copy link
Member

Let's rather move discussion about "supporting portrait back" in #16783 instead, rather than #12764 (also tempted to convert #12764 into a discussion thread as well because there's not really a decided direction for it yet as far as I've seen).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants