Modern Apps git

← Modern-Apps.git

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

Commit
bf57559a28a269232c1942cd989250a504bc418a
Author
Vayun Mathur <[email protected]>
When
2026-12-05 14:37 UTC (16 hours ago)
Parents
3b6a288
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: :appstore:compileDevKotlin (lint/test in the sweep run).

Diff

appstore/src/main/java/com/vayunmathur/appstore/sync/WearSyncManager.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/sync/WearSyncManager.kt b/appstore/src/main/java/com/vayunmathur/appstore/sync/WearSyncManager.ktindex bef013a720..2d8418ceee 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/sync/WearSyncManager.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/sync/WearSyncManager.kt@@ -1,6 +1,7 @@ package com.vayunmathur.appstore.sync  import android.content.Context+import android.content.Intent import com.vayunmathur.appstore.data.UnifiedApp import com.vayunmathur.library.wearlink.appstore.ApkHash import com.vayunmathur.library.wearlink.appstore.ApkOffer@@ -60,6 +61,10 @@ class WearSyncManager(      private val listener = object : WearLinkListener {         override fun onMessage(path: String, body: ByteArray) {+            if (path.endsWith("/open-on-phone")) {+                runCatching { context.startActivity(Intent(context, com.vayunmathur.appstore.MainActivity::class.java).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK).putExtra("wear_open_id", body.decodeToString())) }+                return+            }             if (path != WearSyncProtocol.INSTALL_RESULT_PATH) return             val result = runCatching {                 WearSyncProtocol.json.decodeFromString<InstallResult>(body.decodeToString())
appstore/src/main/java/com/vayunmathur/appstore/ui/WearMainActivity.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/ui/WearMainActivity.kt b/appstore/src/main/java/com/vayunmathur/appstore/ui/WearMainActivity.ktindex ec14f0281e..6f0b295670 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/ui/WearMainActivity.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/ui/WearMainActivity.kt@@ -21,6 +21,11 @@ import com.vayunmathur.appstore.data.WearStore import com.vayunmathur.library.wearlink.appstore.WatchAppPhase import com.vayunmathur.appstore.platform.WearInstaller import com.vayunmathur.library.wearlink.WearShellActivity+import androidx.compose.runtime.rememberCoroutineScope+import androidx.compose.ui.platform.LocalContext+import com.vayunmathur.library.ui.IconMobileArrowRight+import com.vayunmathur.library.wearlink.wearOpenOnPhoneItem+import kotlinx.coroutines.launch  /**  * The whole watch store: what the phone offered, what is already downloaded@@ -83,6 +88,8 @@ internal fun WearStoreContent(     onInstall: (com.vayunmathur.appstore.data.WearRow) -> Unit, ) {     val listState = rememberScalingLazyListState()+    val context = LocalContext.current+    val scope = rememberCoroutineScope()      ScalingLazyColumn(state = listState) {         item {@@ -107,6 +114,7 @@ internal fun WearStoreContent(         items(rows, key = { it.app.packageName }) { row ->             WearRowChip(row.app.name, row.phase, row.installRequested) { onInstall(row) }         }+        wearOpenOnPhoneItem(onClick = { scope.launch { com.vayunmathur.appstore.sync.WearLinkBridge.get(context).sendMessage("/appstore/open-on-phone", ByteArray(0)) } }, icon = { IconMobileArrowRight(tint = androidx.compose.ui.graphics.Color.White) })     } } 
metadata_data/photos/appstore/wear/1.png
diff --git a/metadata_data/photos/appstore/wear/1.png b/metadata_data/photos/appstore/wear/1.pngnew file mode 100644index 0000000000..aef9774408Binary files /dev/null and b/metadata_data/photos/appstore/wear/1.png differ