Improve rotations logic

This commit is contained in:
Gamer64ytb 2024-04-21 12:57:14 +02:00
parent a68e2f1544
commit d6723c6689

View File

@ -422,8 +422,10 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram
private fun rotateScreen() {
if (resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) {
(context as? EmulationActivity)?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
} else {
} else if (resources.configuration.orientation == Configuration.ORIENTATION_LANDSPACE) {
(context as? EmulationActivity)?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
} else {
(context as? EmulationActivity)?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
}
}