Good morning droids! One question that I have been...
# android
m
Good morning droids! One question that I have been asking myself since the last couple of days: I've got an app, developed in PORTRAIT only since the beginning. What would be the best approach to let it support large screens now, in terms of unlocking the rotation? I've tried to let the screen rotate freely (with activity recreation) but it causes so many problems everywhere. Using
android:configChanges
resolves most of those issues and the rotation is also faster, but it seems that it's not a final solution. Keep in mind, the UI and layouts aren't changing when rotating. Just that.
not kotlin but kotlin colored 3
j
The way I have accomplished this is by taking the orientation constraint out of the manifest and applying the constraint programmatically based on criteria with
requestedOrientation
in the Activity
onCreate
. If your criteria is simple, you might check if you can set the value in the manifest with a configuration specific resource value. I cannot recall off hand if that worked in this case. You may also want to check that it behaves the way you wish when in multi window mode.
🙏 1