fix: the app follows automatic landscape rotation again unless an orientation was picked

This commit is contained in:
maxjivi05 committed 2026-10-23 15:48:03 -04:00
1 parent 8f0bd51fd8
commit 6378c3f3d2
4 files changed
+6 -6

No files matched your search

@@ -50,9 +50,9 @@ object SessionPrefs {
)
fun orientation(context: Context): Int =
prefs(context).getInt("orientation", ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)
prefs(context).getInt("orientation", ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE)
.takeIf { value -> orientationOptions.any { it.first == value } }
?: ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
?: ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
fun setOrientation(context: Context, orientation: Int) {
require(orientationOptions.any { it.first == orientation })