Open rilygreat opened 1 year ago
I recently switched to a foldable device and this issue is way worse for those devices. If you open habitica with the device unfolded you get the nice wide layout, but when you close it, you get the layout as pictured above.
What is happening here is that the MainActivity has 2 layouts, one for normal screens and one for wide screens. When the device is rotated the screen is wider so that one gets used.
However, the code has:
android:configChanges="screenSize | smallestScreenSize | screenLayout | orientation"
The last bit there tells the system to notify the activity when the orientation changes instead of recreating it. The activity doesn't actually have any code to handle this though.
This means that then app is opened, it ends up using whichever layout is appropriate for the current orientation/screen size, and then it never changes until the Activity is recreated. Since you spend 90% of your time in just this 1 Activity that doesn't happen very often.
There is a commit from a while back mentioning that screenSize and such were added to improve multi window behavior, but it is unclear to me why MainActivity would ever ignore orientation changes.
Removing that bit ca
steps to reproduce: