Modern Apps git

← Modern-Apps.git

launcher: fix watch design (no Back buttons, centered filled actions)

Commit
5579bfb1b0aea3ea50a42b2f2a83dd292167b086
Author
Vayun Mathur <[email protected]>
When
2026-12-05 14:37 UTC (13 hours ago)
Parents
c02ac01
Remove bottom text Back chips from watch screens (system back
now pops the shared WearBackStack), add a centered filled
Open on phone button with the mobile-arrow-right icon on
detail/summary screens, and convert existing watch deletes to
a red filled Delete button below it where a real watch delete
path already exists (notes: Delete note via store op, todo:
Delete task via its confirm route). Open on phone sends the
/<app>/open-on-phone conduit message; the phone sync opens the
app main activity with the entity id extra. List/nav chips and
toggles keep their component types; no Outlined/TextButton
remains on watch screens.

Verified: :launcher:compileDevKotlin (lint/test in the sweep run).

Diff

launcher/src/main/java/com/vayunmathur/launcher/sync/WearLauncherSync.kt
diff --git a/launcher/src/main/java/com/vayunmathur/launcher/sync/WearLauncherSync.kt b/launcher/src/main/java/com/vayunmathur/launcher/sync/WearLauncherSync.ktindex b0072e3918..b14edf9a4d 100644--- a/launcher/src/main/java/com/vayunmathur/launcher/sync/WearLauncherSync.kt+++ b/launcher/src/main/java/com/vayunmathur/launcher/sync/WearLauncherSync.kt@@ -1,6 +1,7 @@ package com.vayunmathur.launcher.sync  import android.content.Context+import android.content.Intent import android.content.pm.PackageManager import com.vayunmathur.launcher.data.LauncherRepository import com.vayunmathur.launcher.domain.ContainerRef@@ -81,6 +82,10 @@ class WearLauncherSync private constructor(context: Context) {         }          override fun onMessage(path: String, body: ByteArray) {+            if (path.endsWith("/open-on-phone")) {+                runCatching { appContext.startActivity(Intent(appContext, com.vayunmathur.launcher.MainActivity::class.java).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK).putExtra("wear_open_id", body.decodeToString())) }+                return+            }             if (path != WearLauncherProtocol.REQUEST_SYNC_PATH) return             scope.launch { publishFavorites() }         }
launcher/src/main/java/com/vayunmathur/launcher/ui/WearAllAppsScreen.kt
diff --git a/launcher/src/main/java/com/vayunmathur/launcher/ui/WearAllAppsScreen.kt b/launcher/src/main/java/com/vayunmathur/launcher/ui/WearAllAppsScreen.ktindex bae7cc0208..5f3716de14 100644--- a/launcher/src/main/java/com/vayunmathur/launcher/ui/WearAllAppsScreen.kt+++ b/launcher/src/main/java/com/vayunmathur/launcher/ui/WearAllAppsScreen.kt@@ -109,13 +109,5 @@ internal fun WearAllAppsContent(                 WearAppChip(app) { onLaunch(app) }             }         }-        item {-            Chip(-                onClick = onBack,-                label = { Text(stringResource(R.string.wear_back), maxLines = 1) },-                colors = ChipDefaults.secondaryChipColors(),-                modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp),-            )-        }     } }
launcher/src/main/java/com/vayunmathur/launcher/ui/WearSettingsScreen.kt
diff --git a/launcher/src/main/java/com/vayunmathur/launcher/ui/WearSettingsScreen.kt b/launcher/src/main/java/com/vayunmathur/launcher/ui/WearSettingsScreen.ktindex e6a9577467..331e44da56 100644--- a/launcher/src/main/java/com/vayunmathur/launcher/ui/WearSettingsScreen.kt+++ b/launcher/src/main/java/com/vayunmathur/launcher/ui/WearSettingsScreen.kt@@ -1,4 +1,11 @@ package com.vayunmathur.launcher.ui+import com.vayunmathur.launcher.sync.WearLinkBridge+import com.vayunmathur.library.wearlink.wearOpenOnPhoneItem+import com.vayunmathur.library.ui.IconMobileArrowRight+import androidx.compose.runtime.rememberCoroutineScope+import kotlinx.coroutines.launch+import com.vayunmathur.library.ui.IconDelete+import com.vayunmathur.library.wearlink.wearDeleteItem  import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding@@ -46,6 +53,8 @@ internal fun WearSettingsContent(     onBack: () -> Unit, ) {     val listState = rememberScalingLazyListState()+    val context = LocalContext.current+    val scope = rememberCoroutineScope()      ScalingLazyColumn(state = listState) {         item {@@ -75,13 +84,6 @@ internal fun WearSettingsContent(                 )             }         }-        item {-            Chip(-                onClick = onBack,-                label = { Text(stringResource(R.string.wear_back), maxLines = 1) },-                colors = ChipDefaults.secondaryChipColors(),-                modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp),-            )-        }+        wearOpenOnPhoneItem(onClick = { scope.launch { WearLinkBridge.get(context).sendMessage("/launcher/open-on-phone", ByteArray(0)) } }, icon = { IconMobileArrowRight(tint = androidx.compose.ui.graphics.Color.White) })     } }