mirror of
https://github.com/skyline-emu/skyline.git
synced 2025-01-07 09:18:13 +01:00
Fix ignore user orientation setting
The default Auto entry is now called Landscape (Auto), which better describes the SCREEN_ORIENTATION_SENSOR_LANDSCAPE property. For devices like the Surface Duo, Oppo Find X, and Flip, to use the folding feature, the user must select the new Auto entry in the settings.
This commit is contained in:
parent
37d162a9aa
commit
4c7fd0447d
@ -507,14 +507,21 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
|
||||
val displayMetrics = DisplayMetrics()
|
||||
windowManager.defaultDisplay.getMetrics(displayMetrics)
|
||||
binding.onScreenGameView.minimumHeight = displayMetrics.heightPixels
|
||||
requestedOrientation = emulationSettings.orientation
|
||||
requestedOrientation =
|
||||
if (emulationSettings.orientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
|
||||
emulationSettings.orientation
|
||||
} else {
|
||||
ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
|
||||
}
|
||||
for (displayFeature in newLayoutInfo.displayFeatures) {
|
||||
val foldFeature = displayFeature as? FoldingFeature
|
||||
foldFeature?.let {
|
||||
//Folding feature separates the display area into two distinct sections
|
||||
if (it.isSeparating) {
|
||||
//Folding feature separates the display area into two distinct sections
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
|
||||
if (foldFeature.orientation == FoldingFeature.Orientation.HORIZONTAL) {
|
||||
if (emulationSettings.orientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED){
|
||||
requestedOrientation = emulationSettings.orientation
|
||||
}
|
||||
if (it.orientation == FoldingFeature.Orientation.HORIZONTAL) {
|
||||
binding.onScreenGameView.minimumHeight = displayFeature.bounds.top
|
||||
}
|
||||
}
|
||||
|
@ -85,12 +85,14 @@
|
||||
<item>Device Aspect Ratio (Stretch to fit)</item>
|
||||
</string-array>
|
||||
<string-array name="orientation_entries">
|
||||
<item>Landscape (auto)</item>
|
||||
<item>Auto</item>
|
||||
<item>Landscape</item>
|
||||
<item>Landscape (reverse)</item>
|
||||
</string-array>
|
||||
<integer-array name="orientation_values">
|
||||
<item>6</item>
|
||||
<item>-1</item>
|
||||
<item>0</item>
|
||||
<item>8</item>
|
||||
</integer-array>
|
||||
|
Loading…
Reference in New Issue
Block a user