mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-27 02:31:52 +01:00
Enable full screen on resume
* Fix registering of buttons pairs in OSC with multiple fingers * Enable OSC by default * Increased OSC scale by default
This commit is contained in:
parent
1fae3488ad
commit
4b53a3b1a6
@ -194,14 +194,6 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
window.insetsController?.hide(WindowInsets.Type.navigationBars() or WindowInsets.Type.systemBars() or WindowInsets.Type.systemGestures() or WindowInsets.Type.statusBars())
|
||||
window.insetsController?.systemBarsBehavior = WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
or View.SYSTEM_UI_FLAG_FULLSCREEN)
|
||||
}
|
||||
|
||||
binding.gameView.holder.addCallback(this)
|
||||
@ -239,6 +231,20 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
|
||||
executeApplication(intent.data!!)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
||||
@Suppress("DEPRECATION")
|
||||
window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
or View.SYSTEM_UI_FLAG_FULLSCREEN)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used to stop the currently executing ROM and replace it with the one specified in the new intent
|
||||
*/
|
||||
|
@ -30,7 +30,7 @@ class ControllerConfigurationImpl(private val context : Context, private val but
|
||||
private inline fun <reified T> config(default : T, prefix : String = "${buttonId.name}_") = sharedPreferences(context, default, prefix, "controller_config")
|
||||
|
||||
override var enabled by config(true)
|
||||
override var globalScale by config(1f, "")
|
||||
override var globalScale by config(1.15f, "")
|
||||
override var relativeX by config(defaultRelativeX)
|
||||
override var relativeY by config(defaultRelativeY)
|
||||
}
|
||||
|
@ -87,16 +87,18 @@ class OnScreenControllerView @JvmOverloads constructor(context : Context, attrs
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
if (pointerId == button.touchPointerId) {
|
||||
for (buttonPair in controls.buttonPairs) {
|
||||
if (buttonPair.contains(button)) {
|
||||
for (otherButton in buttonPair) {
|
||||
if (otherButton != button && otherButton.config.enabled && otherButton.isTouched(x, y)) {
|
||||
otherButton.partnerPointerId = pointerId
|
||||
otherButton.onFingerDown(x, y)
|
||||
performClick()
|
||||
onButtonStateChangedListener?.invoke(otherButton.buttonId, ButtonState.Pressed)
|
||||
handled = true
|
||||
for (fingerId in 0 until event.pointerCount) {
|
||||
if (fingerId == button.touchPointerId) {
|
||||
for (buttonPair in controls.buttonPairs) {
|
||||
if (buttonPair.contains(button)) {
|
||||
for (otherButton in buttonPair) {
|
||||
if (otherButton != button && otherButton.config.enabled && otherButton.isTouched(event.getX(fingerId), event.getY(fingerId))) {
|
||||
otherButton.partnerPointerId = fingerId
|
||||
otherButton.onFingerDown(x, y)
|
||||
performClick()
|
||||
onButtonStateChangedListener?.invoke(otherButton.buttonId, ButtonState.Pressed)
|
||||
handled = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -94,18 +94,21 @@ class OnScreenEditActivity : AppCompatActivity() {
|
||||
fabMapping[pair.first] = this
|
||||
})
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
window.insetsController?.hide(WindowInsets.Type.navigationBars() or WindowInsets.Type.systemBars() or WindowInsets.Type.systemGestures() or WindowInsets.Type.statusBars())
|
||||
window.insetsController?.systemBarsBehavior = WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
fullScreen()
|
||||
}
|
||||
|
||||
private fun fullScreen() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
window.insetsController?.hide(WindowInsets.Type.navigationBars() or WindowInsets.Type.systemBars() or WindowInsets.Type.systemGestures() or WindowInsets.Type.statusBars())
|
||||
window.insetsController?.systemBarsBehavior = WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
||||
@Suppress("DEPRECATION")
|
||||
window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
|
@ -22,7 +22,7 @@ class Settings(context : Context) {
|
||||
|
||||
var operationMode by sharedPreferences(context, true)
|
||||
|
||||
var onScreenControl by sharedPreferences(context, false)
|
||||
var onScreenControl by sharedPreferences(context, true)
|
||||
|
||||
var onScreenControlRecenterSticks by sharedPreferences(context, true)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user