https://kotlinlang.org logo
#compose
Title
# compose
b

Bradleycorn

03/09/2021, 2:40 PM
hmmm ... I have a somewhat weird issue ... I have setup the manifest for my app to handle orientation changes myself:
Copy code
android:configChanges="orientation|screenSize"
When I run my app, everything works as expected ... when I rotate the device the activity does not get re-created, and my main
setContent
composable gets recomposed. But ... if I rotate the device "upside down", the composable does NOT get recomposed? What am I missing? To be clear .. the device (a phone) starts in a "normal" portrait orientation ... i rotate it 90 degrees to a landscape orientatin and my root composable gets recomposed. Great. I rotate 90 degrees again to portrait (but now upside down, with the earpiece at the bottom and the mic at the top), and my root composable does NOT get recomposed and the display is now "sideways"?
Some more screen shots of the other "working" orientations...
t

Timo Drick

03/09/2021, 2:53 PM
Can you try to add this to the manifes: android:screenOrientation="fullUser" And i use: android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|keyboard"
b

Bradleycorn

03/09/2021, 3:00 PM
yep, adding the
fullUser
orientation in the manifest fixes it
thanks @Timo Drick
👍 1
i

Ian Lake

03/09/2021, 3:29 PM
The "reverse portrait" orientation is off by default - keep in mind that there are devices with physical buttons where having those along the top of the screen is generally very disorienting compared to other orientations
b

Bradleycorn

03/09/2021, 5:55 PM
Thanks @Ian Lake. Yeah, I'm not sure I'll use it, I was mainly just wondering if I had done something weird to "break" it. If anything, I might actually make the UI display upside down when the phone is oriented that way to make it obvious to the user that they probably want to flip it the other way around.