From 06c6c3214b06bd919138eddd5398abe1010fbde4 Mon Sep 17 00:00:00 2001 From: ScreenTinker Date: Mon, 8 Jun 2026 19:18:29 -0500 Subject: [PATCH] fix(android): make pairing code fit/visible on all screen sizes Reported on a Pixel 10: the pairing code wasn't visible. The provisioning screen was a non-scrolling vertical stack, and when the pairing section appeared below the server-URL + Connect controls, the fixed 64sp code got pushed off-screen on short/landscape phones (and could clip horizontally on narrow widths). - Wrap the screen in a ScrollView (fillViewport) so content is always reachable. - pairingCodeText now auto-sizes (autoSizeTextType=uniform, 24-96sp, single line, match_parent width) so it fills the width and never clips - phones, TVs, sticks. - Hide the server-URL section + Connect button once paired so the code gets the full screen. Compile-checked + signed APK builds. Needs on-device confirmation (Pixel 10 / onn stick) that the code is now visible. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../player/ProvisioningActivity.kt | 6 + .../main/res/layout/activity_provisioning.xml | 208 ++++++++++-------- 2 files changed, 119 insertions(+), 95 deletions(-) diff --git a/android/app/src/main/java/com/remotedisplay/player/ProvisioningActivity.kt b/android/app/src/main/java/com/remotedisplay/player/ProvisioningActivity.kt index 432c327..acb53c4 100644 --- a/android/app/src/main/java/com/remotedisplay/player/ProvisioningActivity.kt +++ b/android/app/src/main/java/com/remotedisplay/player/ProvisioningActivity.kt @@ -34,6 +34,7 @@ class ProvisioningActivity : AppCompatActivity() { private lateinit var statusText: TextView private lateinit var progressBar: ProgressBar private lateinit var pairingSection: View + private lateinit var serverSection: View private val connection = object : ServiceConnection { override fun onServiceConnected(name: ComponentName?, service: IBinder?) { @@ -73,6 +74,7 @@ class ProvisioningActivity : AppCompatActivity() { statusText = findViewById(R.id.statusText) progressBar = findViewById(R.id.progressBar) pairingSection = findViewById(R.id.pairingSection) + serverSection = findViewById(R.id.serverSection) // Pre-fill if previously entered if (config.serverUrl.isNotEmpty()) { @@ -135,6 +137,10 @@ class ProvisioningActivity : AppCompatActivity() { wsService?.onRegistered = { deviceId -> runOnUiThread { progressBar.visibility = View.GONE + // Hide the server/connect controls so the pairing code has the + // whole screen and stays visible on short/landscape phones. + serverSection.visibility = View.GONE + connectBtn.visibility = View.GONE pairingSection.visibility = View.VISIBLE pairingCodeText.text = wsService?.getPairingCode() ?: "------" statusText.text = "Enter this code in the dashboard to pair this display" diff --git a/android/app/src/main/res/layout/activity_provisioning.xml b/android/app/src/main/res/layout/activity_provisioning.xml index 9726069..cf44d29 100644 --- a/android/app/src/main/res/layout/activity_provisioning.xml +++ b/android/app/src/main/res/layout/activity_provisioning.xml @@ -1,123 +1,141 @@ - + + android:fillViewport="true" + android:background="#111827"> - - - - - + android:padding="32dp" + android:keepScreenOn="true"> - - - -