diff --git a/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt b/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt index 8889ad34c..62a672054 100644 --- a/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt @@ -905,6 +905,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { onQam = { if (SessionState.mode == SessionService.MODE_STEAM) padBridge?.triggerQam() }, + onClose = { selectSecondScreenMode(SecondScreenMode.NONE) }, ) secondScreenPresentation = presentation } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt b/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt index 818d72624..3a4bdb2ef 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SecondScreenPresentation.kt @@ -44,6 +44,7 @@ class SecondScreenPresentation( private val sendWheel: (steps: Int) -> Unit, private val onSteamMenu: () -> Unit, private val onQam: () -> Unit, + private val onClose: () -> Unit, ) : Presentation(sessionActivity, display) { private val root = LinearLayout(context).apply { orientation = LinearLayout.VERTICAL @@ -124,6 +125,12 @@ class SecondScreenPresentation( setPadding(dp(12), dp(8), dp(12), dp(8)) setBackgroundColor(0xE6191E24.toInt()) } + controls.addView(Button(context).apply { + text = "×" + contentDescription = "Close second-screen controls" + minWidth = dp(48) + setOnClickListener { onClose() } + }) controls.addView(TextView(context).apply { text = "Trackpad" textSize = 14f @@ -169,6 +176,12 @@ class SecondScreenPresentation( setPadding(dp(8), dp(4), dp(8), dp(4)) setBackgroundColor(Color.rgb(27, 32, 38)) } + bar.addView(Button(context).apply { + text = "×" + contentDescription = "Close second-screen controls" + minWidth = dp(48) + setOnClickListener { onClose() } + }) bar.addView(TextView(context).apply { text = "Linux terminal" textSize = 14f