mirror of
https://github.com/skyline-emu/skyline.git
synced 2025-01-08 11:10:44 +01:00
Some fixes after testing
This is the only way requestedOrientation works after exiting portrait mode on the folding device. displayHeight must be there for the gameView to be centered; this has become necessary due to changes in emu_activity.xml
This commit is contained in:
parent
88f56d814d
commit
7dabe1ec60
@ -515,17 +515,15 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
|
|||||||
* Updating the layout depending on type and state of device
|
* Updating the layout depending on type and state of device
|
||||||
*/
|
*/
|
||||||
private fun updateCurrentLayout(newLayoutInfo: WindowLayoutInfo) {
|
private fun updateCurrentLayout(newLayoutInfo: WindowLayoutInfo) {
|
||||||
|
requestedOrientation = emulationSettings.orientation
|
||||||
|
binding.onScreenGameView.minimumHeight = displayHeight
|
||||||
if (!emulationSettings.supportFoldableScreen) return
|
if (!emulationSettings.supportFoldableScreen) return
|
||||||
val foldingFeature = newLayoutInfo.displayFeatures.find { it is FoldingFeature }
|
val foldingFeature = newLayoutInfo.displayFeatures.find { it is FoldingFeature }
|
||||||
(foldingFeature as? FoldingFeature)?.let {
|
(foldingFeature as? FoldingFeature)?.let {
|
||||||
binding.onScreenGameView.minimumHeight = displayHeight
|
|
||||||
requestedOrientation = emulationSettings.orientation
|
|
||||||
if (it.isSeparating) {
|
if (it.isSeparating) {
|
||||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
|
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
|
||||||
if (it.orientation == FoldingFeature.Orientation.HORIZONTAL)
|
if (it.orientation == FoldingFeature.Orientation.HORIZONTAL)
|
||||||
binding.onScreenGameView.minimumHeight = it.bounds.top
|
binding.onScreenGameView.minimumHeight = it.bounds.top
|
||||||
else
|
|
||||||
requestedOrientation = emulationSettings.orientation
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user