Cwa-wishlist: Screen rotation / landscape mode shows, but immediately switches back to portrait

Created on 18 Jun 2020  路  9Comments  路  Source: corona-warn-app/cwa-wishlist

Describe the bug

Screen rotation / landscape mode shows for < 1 s, but immediately switches back to portrait.

Expected behaviour

Show app in landscape mode.

Steps to reproduce the issue

  • Turn on screen rotation in system settings.
  • Turn phone so it shows desktop (seperate setting) or any other app in landscape mode.
  • Open CWA.

  • [ Screen shows in landscape, then immediately switches back to portrait. ]

Technical details

  • Android Lineage OS 16

Additional context

People using their old phones with broken screens is the main reason this is important. Especially if your main phone is google free... :crying_cat_face:


Internal Tracking Id: EXPOSUREAPP-2109

app mirrored-to-jira ux

Most helpful comment

Looked into source, this app forces portrait mode with this command:

activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT

It appears that it was never designed to support landscape.

IMO this is rather a feature request than a bug.

To support landscape the app would need additional layout resources to rearrange the UI components accordingly. Also it might require additional code to store and reload the activity state when screen orientation changes.

This is not impossible to do, but it will require more effort than just removing the portrait mode flag.

All 9 comments

Looked into source, this app forces portrait mode with this command:

activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT

It appears that it was never designed to support landscape.

IMO this is rather a feature request than a bug.

To support landscape the app would need additional layout resources to rearrange the UI components accordingly. Also it might require additional code to store and reload the activity state when screen orientation changes.

This is not impossible to do, but it will require more effort than just removing the portrait mode flag.

I assume that the cause is that the screen orientation is set after creation of the activity (L108), i.e. the activity is created in landscape, then turned:
https://github.com/corona-warn-app/cwa-app-android/blob/970e8b859cff3c8beeca83ac83e9ed534927107a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/CoronaWarnApplication.kt#L97-L109

Adding android:screenOrientation="portrait" to the corresponding activity-tag in the AndroidManifest.xml may fix this issue/create and lock the activity in portrait mode.

To clarify: Please support landscape mode, so that as many people as possible can use the app on phones with broken screens. If part of your touchscreen is broken, you can rotate the app to press buttons with other parts of your physical touch screen.

This would allow for:

  • people with liberated phones using the app with their old/backup phone
  • people sharing their old/backup phones with friends that either not own a smartphone themselves or only own unsupported phones

i.e. it might help with wide-spread usage of the app.

@hrehfeld Ah, sorry. Mixed two topics.

  • Your report: "add support for landscape mode" (should be an enhancement as suggested by @jbauerrfid )
  • A bug: "landscape is shown for 1s but should not appear at all" - current expected design in portrait only; this is what I understood after seeing the bug label and quickly skmming through the issue comments ;)

@hrehfeld Thank you for your input!
Unfortunately, @jbauerrfid is right: this application was designed for portrait mode.
But the landscape mode is already in our backlog and I will report your points to the team.
I will keep this issue open, so we could update you as soon as there would be any news.
Thank you.

Since landscape mode is a feature request that touches both applications, we will move it to the wishlist repository.

Why do we need to bother with landscape mode for a fire-and-forget app (name coined by an owner in another issue)?! Especially for phones and such a simple app this is not really needed. There are wy more important features to develop.

I specifically gave a reason in the first post:

People using their old phones with broken screens is the main reason this is important. Especially if your main phone is google free...

E.g. the new screens added in one of the previous updates are not touchable on my spare phone's broken screen. My grandma doesn't have CWA because I can't give her this phone with the app running.

Oh interesting reason 馃槄 Never though as app developer that screen rotation makes sense because of this. Thx for the hint 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MikeMcC399 picture MikeMcC399  路  3Comments

Marvodor picture Marvodor  路  3Comments

durator picture durator  路  3Comments

ststoessel picture ststoessel  路  4Comments

timia2109 picture timia2109  路  4Comments