From 2812613bcaf27a8c35f97630cd36479084c0d0e5 Mon Sep 17 00:00:00 2001 From: Seb3thehacker Date: Tue, 13 Oct 2026 17:14:32 -0700 Subject: [PATCH] wireless: say the car must be paired first, with a button to Bluetooth settings --- .../gearslip/ui/WirelessButton.kt | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/WirelessButton.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/WirelessButton.kt index 46fa77f..109569d 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/WirelessButton.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/WirelessButton.kt @@ -1,6 +1,8 @@ package app.seb3thehacker.gearslip.ui import android.Manifest +import android.content.Intent +import android.provider.Settings import android.bluetooth.BluetoothDevice import android.content.pm.PackageManager import android.os.Build @@ -85,7 +87,7 @@ internal fun WirelessButton() { text = { Column(Modifier.verticalScroll(rememberScrollState())) { if (list.isEmpty()) { - Text("No paired devices. Pair the phone with the car over Bluetooth first.") + Text("Your phone isn't paired with anything yet. Pair it with the car first.") } list.forEach { device -> Text( @@ -100,8 +102,25 @@ internal fun WirelessButton() { .padding(vertical = 14.dp), ) } + // The car has to be paired before it shows up here, and pairing happens in Android's settings. + if (list.isNotEmpty()) { + Text( + "Car not listed? Pair it with your phone first.", + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.onSurfaceVariant, + modifier = Modifier.padding(top = 8.dp), + ) + } } }, + dismissButton = { + TextButton(onClick = { + devices = null + runCatching { + context.startActivity(Intent(Settings.ACTION_BLUETOOTH_SETTINGS).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)) + } + }) { Text("Bluetooth settings") } + }, confirmButton = { TextButton(onClick = { devices = null }) { Text("Cancel") } }, ) }