Modern Apps git

← Modern-Apps.git

maps: show only the map on the watch

Commit
dda7f8b7bb34e1e307647a0e8ebe8e8b1ba5fb10
Author
Vayun Mathur <[email protected]>
When
2026-12-06 02:52 UTC (1 hour ago)
Parents
9a31f00
Owner report: the watch Maps screen carried explanatory text and
two buttons and should show just the map. Remove the Route/Saved
chips, the route banner, the offline/stale/limited-detail honesty
texts and the no-region phone-directed text from WearMapScreen;
the screen now composes WearMapCanvas and nothing else. Delete
the WearRouteDetailScreen and WearSavedScreen text screens (and
their Open-on-phone conduit senders) and collapse WearRoute to
the single Map destination; WearMainActivity routes only there.

Rendering fix in WearMapCanvas: the canvas is now always drawn,
including before the first snapshot arrives (previously a watch
with nothing synced rendered no map at all, only the phone text).
All stroke widths, dot radii, the bearing cone, scale bar and
north marker were raw pixels, so on the ~320 dpi round watch they
rendered at about half their intended size and the linework read
as missing; they are dp-based now, the scale bar moved to a
round-safe bottom-centre inset, the north blob became a triangle,
and closed water/building rings are explicitly closed for fill.
The renderer stays a plain Canvas: no native renderer is loaded
on the watch (libmap_renderer is arm64-only and cannot load in
32-bit watch userspace), which this change keeps true.

Verified: :maps:lint :maps:lintVitalRelease :maps:testDevUnitTest
pass (see following commit for metadata regen).

Diff

maps/src/main/java/com/vayunmathur/maps/ui/WearMainActivity.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/WearMainActivity.kt b/maps/src/main/java/com/vayunmathur/maps/ui/WearMainActivity.ktindex 488b952778..a3fb560c8c 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/WearMainActivity.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/WearMainActivity.kt@@ -6,9 +6,9 @@ import com.vayunmathur.maps.data.WearMapsStore import com.vayunmathur.maps.sync.WearLinkBridge  /**- * Watch maps entry: the rendered map home, route detail and saved glance,- * all from the locally stored snapshot so they work standalone (phone- * absent, cold start) with stale/offline honesty.+ * Watch maps entry: the rendered map only, from the locally stored+ * snapshot so it works standalone (phone absent, cold start). No+ * phone-directed UI lives here; sync stays in the bridge/store.  */ class WearMainActivity : WearShellActivity<WearRoute, WearMapsStore>(WearRoute.Map) { @@ -24,19 +24,7 @@ class WearMainActivity : WearShellActivity<WearRoute, WearMapsStore>(WearRoute.M     @Composable     override fun Screen(route: WearRoute, navigate: (WearRoute) -> Unit) {         when (route) {-            WearRoute.Map -> WearMapScreen(-                store = store,-                onOpenRoute = { navigate(WearRoute.RouteDetail) },-                onOpenSaved = { navigate(WearRoute.Saved) },-            )-            WearRoute.RouteDetail -> WearRouteDetailScreen(-                store = store,-                onBack = { navigate(WearRoute.Map) },-            )-            WearRoute.Saved -> WearSavedScreen(-                store = store,-                onBack = { navigate(WearRoute.Map) },-            )+            WearRoute.Map -> WearMapScreen(store = store)         }     } }
maps/src/main/java/com/vayunmathur/maps/ui/WearMapCanvas.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/WearMapCanvas.kt b/maps/src/main/java/com/vayunmathur/maps/ui/WearMapCanvas.ktindex e977729485..54e2d1d510 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/WearMapCanvas.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/WearMapCanvas.kt@@ -9,8 +9,10 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Path import androidx.compose.ui.graphics.PathEffect import androidx.compose.ui.graphics.drawscope.Stroke+import androidx.compose.ui.unit.dp import com.vayunmathur.library.wearlink.maps.WearLineKind import com.vayunmathur.library.wearlink.maps.WearMapSnapshot+import com.vayunmathur.library.wearlink.maps.WearMapsProtocol import com.vayunmathur.library.wearlink.maps.WearPosition import com.vayunmathur.library.wearlink.maps.WearRouteState import com.vayunmathur.library.wearlink.maps.wearDequantize@@ -33,28 +35,39 @@ private val UserColor = Color(0xFF4DA3FF)  /**  * Lightweight Canvas renderer for one phone-supplied vector snapshot:- * no tile stack, no map library — just projected polylines/polygons,- * POI dots, the route overlay and the user puck. North-up in v1.+ * no tile stack, no map library, no native renderer (the arm64-only+ * `libmap_renderer` cannot load on 32-bit watch userspace, and none is+ * needed) — just projected polylines/polygons, POI dots, the route+ * overlay and the user puck. North-up in v1.  * Draw order: water/buildings (fills), roads/paths, route, points, user.  * Follows the user when a position is known, else centres the snapshot.+ * A null snapshot still draws the map (land, puck, scale, north) so a+ * cold watch with nothing synced yet shows a map, not text.+ * All stroke/dot sizes are dp-based: the watch display is ~320 dpi, so+ * raw-pixel widths would render at half size and read as missing lines.  */ @Composable fun WearMapCanvas(-    snapshot: WearMapSnapshot,+    snapshot: WearMapSnapshot?,     route: WearRouteState?,     position: WearPosition?, ) {     Canvas(Modifier.fillMaxSize()) {-        val userOffset = position?.let { wearOffsetInSnapshot(snapshot, it.latE7, it.lonE7) }+        val radiusM = snapshot?.radiusM?.takeIf { it > 0 } ?: WearMapsProtocol.REGION_RADIUS_M+        val userOffset = if (snapshot != null) {+            position?.let { wearOffsetInSnapshot(snapshot, it.latE7, it.lonE7) }+        } else {+            null+        }         val projection = WearMapProjection(             viewportWidthPx = size.width,             viewportHeightPx = size.height,-            radiusM = snapshot.radiusM,+            radiusM = radiusM,             centerEastM = userOffset?.first ?: 0.0,             centerNorthM = userOffset?.second ?: 0.0,         )         drawRect(LandColor)-        fun pathOf(flat: List<Int>, toMetres: (Int, Int) -> Pair<Double, Double>): Path {+        fun pathOf(flat: List<Int>, close: Boolean, toMetres: (Int, Int) -> Pair<Double, Double>): Path {             val path = Path()             for (i in flat.indices step 2) {                 if (i + 1 >= flat.size) break@@ -62,54 +75,59 @@ fun WearMapCanvas(                 val (x, y) = projection.project(east, north)                 if (i == 0) path.moveTo(x, y) else path.lineTo(x, y)             }+            if (close) path.close()             return path         }-        val snapshotPts = { dx: Int, dy: Int -> wearDequantize(dx) to wearDequantize(dy) }-        // Basemap only: a ROUTE line baked into the snapshot is not drawn —-        // the live route overlay below is the sole route source, so a-        // cleared or superseded route cannot linger on the map.-        val basemapLines = wearBasemapLines(snapshot)-        // Fills first, then strokes in kind-priority order.-        for (line in basemapLines.filter { it.closed }) {-            val color = if (line.kind == WearLineKind.WATER) WaterColor else BuildingColor-            drawPath(pathOf(line.pts, snapshotPts), color)-        }-        for (kind in listOf(WearLineKind.WATER, WearLineKind.ROAD, WearLineKind.PATH)) {-            for (line in basemapLines.filter { !it.closed && it.kind == kind }) {-                drawPath(-                    pathOf(line.pts, snapshotPts),-                    color = when (kind) {-                        WearLineKind.WATER -> WaterColor-                        WearLineKind.ROAD -> RoadColor-                        else -> PathColor-                    },-                    style = Stroke(-                        width = if (kind == WearLineKind.ROAD) 3f else 2f,-                        pathEffect = if (kind == WearLineKind.PATH) {-                            PathEffect.dashPathEffect(floatArrayOf(6f, 6f))-                        } else {-                            null+        if (snapshot != null) {+            val snapshotPts = { dx: Int, dy: Int -> wearDequantize(dx) to wearDequantize(dy) }+            // Basemap only: a ROUTE line baked into the snapshot is not drawn —+            // the live route overlay below is the sole route source, so a+            // cleared or superseded route cannot linger on the map.+            val basemapLines = wearBasemapLines(snapshot)+            // Fills first, then strokes in kind-priority order.+            for (line in basemapLines.filter { it.closed }) {+                val color = if (line.kind == WearLineKind.WATER) WaterColor else BuildingColor+                drawPath(pathOf(line.pts, close = true, snapshotPts), color)+            }+            for (kind in listOf(WearLineKind.WATER, WearLineKind.ROAD, WearLineKind.PATH)) {+                for (line in basemapLines.filter { !it.closed && it.kind == kind }) {+                    drawPath(+                        pathOf(line.pts, close = false, snapshotPts),+                        color = when (kind) {+                            WearLineKind.WATER -> WaterColor+                            WearLineKind.ROAD -> RoadColor+                            else -> PathColor                         },-                    ),-                )+                        style = Stroke(+                            width = (if (kind == WearLineKind.ROAD) 3.dp else 2.dp).toPx(),+                            pathEffect = if (kind == WearLineKind.PATH) {+                                PathEffect.dashPathEffect(+                                    floatArrayOf(6.dp.toPx(), 6.dp.toPx()),+                                )+                            } else {+                                null+                            },+                        ),+                    )+                }             }-        }-        // Live route overlay (sole route source; see wearBasemapLines).-        if (route?.active == true && route.routePts.size >= 4) {-            val routePath = pathOf(route.routePts) { dx, dy ->-                wearRoutePointInSnapshot(snapshot, route, dx, dy)+            // Live route overlay (sole route source; see wearBasemapLines).+            if (route?.active == true && route.routePts.size >= 4) {+                val routePath = pathOf(route.routePts, close = false) { dx, dy ->+                    wearRoutePointInSnapshot(snapshot, route, dx, dy)+                }+                drawPath(routePath, Color.White, style = Stroke(width = 7.dp.toPx()))+                drawPath(routePath, RouteColor, style = Stroke(width = 5.dp.toPx()))+            }+            for (point in snapshot.points) {+                val (x, y) = projection.project(wearDequantize(point.dx), wearDequantize(point.dy))+                drawCircle(PoiColor, radius = 3.5.dp.toPx(), center = Offset(x, y))+            }+            for (place in snapshot.saved) {+                val (east, north) = wearOffsetInSnapshot(snapshot, place.latE7, place.lonE7)+                val (x, y) = projection.project(east, north)+                drawCircle(SavedColor, radius = 4.5.dp.toPx(), center = Offset(x, y))             }-            drawPath(routePath, Color.White, style = Stroke(width = 7f))-            drawPath(routePath, RouteColor, style = Stroke(width = 5f))-        }-        for (point in snapshot.points) {-            val (x, y) = projection.project(wearDequantize(point.dx), wearDequantize(point.dy))-            drawCircle(PoiColor, radius = 3.5f, center = Offset(x, y))-        }-        for (place in snapshot.saved) {-            val (east, north) = wearOffsetInSnapshot(snapshot, place.latE7, place.lonE7)-            val (x, y) = projection.project(east, north)-            drawCircle(SavedColor, radius = 4.5f, center = Offset(x, y))         }         // User puck last, with a bearing cone when the phone reported one.         val (ux, uy) = if (userOffset != null) {@@ -117,31 +135,44 @@ fun WearMapCanvas(         } else {             projection.project(0.0, 0.0)         }-        val bearing = position?.bearingDeg ?: snapshot.userBearingDeg+        val bearing = position?.bearingDeg ?: snapshot?.userBearingDeg ?: -1         if (bearing >= 0) {             val rad = Math.toRadians(bearing.toDouble())+            val coneLength = 26.dp.toPx()             val cone = Path().apply {                 moveTo(ux, uy)                 lineTo(-                    ux + 26f * sin(rad - 0.35).toFloat(),-                    uy - 26f * cos(rad - 0.35).toFloat(),+                    ux + coneLength * sin(rad - 0.35).toFloat(),+                    uy - coneLength * cos(rad - 0.35).toFloat(),                 )                 lineTo(-                    ux + 26f * sin(rad + 0.35).toFloat(),-                    uy - 26f * cos(rad + 0.35).toFloat(),+                    ux + coneLength * sin(rad + 0.35).toFloat(),+                    uy - coneLength * cos(rad + 0.35).toFloat(),                 )                 close()             }             drawPath(cone, UserColor.copy(alpha = 0.35f))         }-        drawCircle(Color.White, radius = 8f, center = Offset(ux, uy))-        drawCircle(UserColor, radius = 6f, center = Offset(ux, uy))-        // Scale bar centred on the bottom centreline and north marker on the-        // top centreline: corners are outside the visible circle on round watches.+        drawCircle(Color.White, radius = 8.dp.toPx(), center = Offset(ux, uy))+        drawCircle(UserColor, radius = 6.dp.toPx(), center = Offset(ux, uy))+        // Scale bar and north marker on the centrelines, inset in dp so+        // neither sits in the bezel corners on round watches.         val scalePx = (100.0 * projection.pixelsPerMeter).toFloat()-        // Above the bottom chip row so the controls never cover it.-        val scaleY = size.height * 0.70f-        drawLine(Color.White, Offset(size.width / 2f - scalePx / 2f, scaleY), Offset(size.width / 2f + scalePx / 2f, scaleY), 3f)-        drawCircle(Color.DarkGray, radius = 13f, center = Offset(size.width / 2f, 18f))+        val scaleY = size.height - 24.dp.toPx()+        drawLine(+            Color.White,+            Offset(size.width / 2f - scalePx / 2f, scaleY),+            Offset(size.width / 2f + scalePx / 2f, scaleY),+            strokeWidth = 3.dp.toPx(),+        )+        val northY = 20.dp.toPx()+        val northHalf = 7.dp.toPx()+        val north = Path().apply {+            moveTo(size.width / 2f, northY - northHalf)+            lineTo(size.width / 2f - northHalf, northY + northHalf)+            lineTo(size.width / 2f + northHalf, northY + northHalf)+            close()+        }+        drawPath(north, Color.White)     } }
maps/src/main/java/com/vayunmathur/maps/ui/WearMapScreen.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/WearMapScreen.kt b/maps/src/main/java/com/vayunmathur/maps/ui/WearMapScreen.ktindex b5588fa0ec..04fdabe667 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/WearMapScreen.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/WearMapScreen.kt@@ -1,45 +1,23 @@ package com.vayunmathur.maps.ui -import androidx.compose.foundation.layout.Box-import androidx.compose.foundation.lazy.LazyRow-import androidx.compose.foundation.layout.Column-import androidx.compose.foundation.layout.fillMaxSize-import androidx.compose.foundation.layout.fillMaxWidth-import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue-import androidx.compose.runtime.remember-import androidx.compose.ui.Alignment-import androidx.compose.ui.Modifier-import androidx.compose.ui.res.stringResource-import androidx.compose.ui.text.style.TextAlign-import androidx.compose.ui.unit.dp-import androidx.wear.compose.material.Chip-import androidx.wear.compose.material.ChipDefaults-import androidx.wear.compose.material.MaterialTheme-import androidx.wear.compose.material.Text-import com.vayunmathur.maps.R import com.vayunmathur.maps.data.WearMapsStore-import com.vayunmathur.maps.domain.wearIsStale  /**- * Map home page: the rendered region with the user (and route, when the- * phone is navigating) on it. Honesty labels sit under the map: offline- * when the link is down, stale when the snapshot aged out, and a limited-- * detail note when the phone flagged missing linework.+ * Map home page: just the rendered region with the user (and route, when+ * the phone is navigating) on it. No phone-directed text, buttons or+ * actions: the watch shows the map standalone from the locally stored+ * snapshot, and [WearMapCanvas] still draws the (empty) map before the+ * first snapshot arrives.  */ @Composable-fun WearMapScreen(-    store: WearMapsStore,-    onOpenRoute: () -> Unit,-    onOpenSaved: () -> Unit,-) {+fun WearMapScreen(store: WearMapsStore) {     val snapshot by store.snapshot.collectAsState()     val route by store.route.collectAsState()     val position by store.position.collectAsState()-    val connected by store.connected.collectAsState()-    WearMapContent(snapshot = snapshot, route = route, position = position, connected = connected, nowMillis = System.currentTimeMillis(), onOpenRoute = onOpenRoute, onOpenSaved = onOpenSaved)+    WearMapContent(snapshot = snapshot, route = route, position = position) }  /** Stateless map behind [WearMapScreen]: snapshot/route/position are parameters for previews. */@@ -48,93 +26,6 @@ internal fun WearMapContent(     snapshot: com.vayunmathur.library.wearlink.maps.WearMapSnapshot?,     route: com.vayunmathur.library.wearlink.maps.WearRouteState?,     position: com.vayunmathur.library.wearlink.maps.WearPosition?,-    connected: Boolean,-    nowMillis: Long,-    onOpenRoute: () -> Unit,-    onOpenSaved: () -> Unit, ) {--    Box(Modifier.fillMaxSize()) {-        val current = snapshot-        if (current == null) {-            Text(-                stringResource(R.string.wear_no_region),-                style = MaterialTheme.typography.body2,-                textAlign = TextAlign.Center,-                modifier = Modifier.fillMaxWidth().padding(16.dp).align(Alignment.Center),-            )-        } else {-            WearMapCanvas(snapshot = current, route = route, position = position)-            Column(Modifier.align(Alignment.TopCenter).padding(top = 18.dp)) {-                if (route?.active == true) {-                    Text(-                        route!!.nextText.ifBlank { route!!.destinationName },-                        style = MaterialTheme.typography.title3,-                        textAlign = TextAlign.Center,-                        modifier = Modifier.fillMaxWidth().padding(horizontal = 20.dp),-                        maxLines = 2,-                    )-                    Text(-                        "${route!!.distanceToNextM} m · ${(route!!.distanceRemainingM / 1000.0)} km left",-                        style = MaterialTheme.typography.body2,-                        textAlign = TextAlign.Center,-                        modifier = Modifier.fillMaxWidth(),-                    )-                }-            }-        }-        // One chip row on the centreline, lifted 22dp: the previous row of-        // circular Buttons at 2dp put text in the bezel corners on round watches,-        // and three stacked full-width chips would cover the centred user puck.-        Column(-            Modifier.align(Alignment.BottomCenter)-                .padding(bottom = 22.dp, start = 20.dp, end = 20.dp),-            horizontalAlignment = Alignment.CenterHorizontally,-        ) {-            // Honesty labels stack directly above the chips so neither sits-            // in the bezel and the centred user puck stays clear.-            val currentSnapshot = snapshot-            if (currentSnapshot != null) {-                val stale = wearIsStale(currentSnapshot, nowMillis)-                when {-                    !connected -> Text(-                        stringResource(R.string.wear_offline),-                        style = MaterialTheme.typography.caption2,-                        textAlign = TextAlign.Center,-                        modifier = Modifier.fillMaxWidth(),-                    )-                    stale -> Text(-                        stringResource(R.string.wear_stale),-                        style = MaterialTheme.typography.caption2,-                        textAlign = TextAlign.Center,-                        modifier = Modifier.fillMaxWidth(),-                    )-                }-                if (currentSnapshot.degraded.isNotEmpty()) {-                    Text(-                        stringResource(R.string.wear_limited_detail),-                        style = MaterialTheme.typography.caption2,-                        textAlign = TextAlign.Center,-                        modifier = Modifier.fillMaxWidth(),-                    )-                }-            }-            LazyRow {-                item {-                    Chip(-                        onClick = onOpenRoute,-                        label = { Text(stringResource(R.string.wear_route), maxLines = 1) },-                        colors = ChipDefaults.secondaryChipColors(),-                    )-                }-                item {-                    Chip(-                        onClick = onOpenSaved,-                        label = { Text(stringResource(R.string.wear_saved), maxLines = 1) },-                        colors = ChipDefaults.secondaryChipColors(),-                    )-                }-            }-        }-    }+    WearMapCanvas(snapshot = snapshot, route = route, position = position) }
maps/src/main/java/com/vayunmathur/maps/ui/WearRoute.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/WearRoute.kt b/maps/src/main/java/com/vayunmathur/maps/ui/WearRoute.ktindex a501cbd767..4016a831bc 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/WearRoute.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/WearRoute.kt@@ -1,13 +1,7 @@ package com.vayunmathur.maps.ui -/** Watch navigation destinations mirroring the phone IA: map home, route detail, saved glance. */+/** Watch navigation destinations: the rendered map home only. */ sealed interface WearRoute {-    /** The rendered map (home). */+    /** The rendered map (home, and the only watch screen). */     data object Map : WearRoute--    /** Maneuver list for the phone's active route. */-    data object RouteDetail : WearRoute--    /** Saved places glance (name + distance; the phone has no Home/Work). */-    data object Saved : WearRoute }
maps/src/main/java/com/vayunmathur/maps/ui/WearRouteDetailScreen.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/WearRouteDetailScreen.kt b/maps/src/main/java/com/vayunmathur/maps/ui/WearRouteDetailScreen.ktdeleted file mode 100644index 84b7cae332..0000000000--- a/maps/src/main/java/com/vayunmathur/maps/ui/WearRouteDetailScreen.kt+++ /dev/null@@ -1,90 +0,0 @@-package com.vayunmathur.maps.ui-import com.vayunmathur.maps.sync.WearLinkBridge-import com.vayunmathur.library.wearlink.wearOpenOnPhoneItem-import com.vayunmathur.library.ui.IconMobileArrowRight-import androidx.compose.runtime.rememberCoroutineScope-import androidx.compose.ui.platform.LocalContext-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-import androidx.compose.runtime.Composable-import androidx.compose.runtime.collectAsState-import androidx.compose.runtime.getValue-import androidx.compose.ui.Modifier-import androidx.compose.ui.res.stringResource-import androidx.compose.ui.text.style.TextAlign-import androidx.compose.ui.unit.dp-import androidx.wear.compose.foundation.lazy.ScalingLazyColumn-import androidx.wear.compose.foundation.lazy.items-import androidx.wear.compose.foundation.lazy.rememberScalingLazyListState-import androidx.wear.compose.material.Chip-import androidx.wear.compose.material.ChipDefaults-import androidx.wear.compose.material.MaterialTheme-import androidx.wear.compose.material.Text-import com.vayunmathur.maps.R-import com.vayunmathur.maps.data.WearMapsStore--/** Route detail page: next maneuver plus the phone's maneuver list, or the no-route honesty. */-@Composable-fun WearRouteDetailScreen(-    store: WearMapsStore,-    onBack: () -> Unit,-) {-    val route by store.route.collectAsState()-    WearRouteDetailContent(route = route, onBack = onBack)-}--/** Stateless route detail behind [WearRouteDetailScreen]: route is a parameter for previews. */-@Composable-internal fun WearRouteDetailContent(route: com.vayunmathur.library.wearlink.maps.WearRouteState?, onBack: () -> Unit) {-    val listState = rememberScalingLazyListState()-    val context = LocalContext.current--    val scope = rememberCoroutineScope()--    ScalingLazyColumn(state = listState) {-        item {-            Text(-                stringResource(R.string.wear_maneuvers),-                style = MaterialTheme.typography.title3,-                textAlign = TextAlign.Center,-                modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp),-            )-        }-        val current = route-        if (current?.active != true) {-            item {-                Text(-                    stringResource(R.string.wear_no_route),-                    style = MaterialTheme.typography.body2,-                    textAlign = TextAlign.Center,-                    modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp),-                )-            }-        } else {-            if (current.destinationName.isNotBlank()) {-                item {-                    Text(-                        current.destinationName,-                        style = MaterialTheme.typography.title3,-                        textAlign = TextAlign.Center,-                        modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp),-                    )-                }-            }-            items(current.maneuvers) { maneuver ->-                Chip(-                    onClick = {}, enabled = false,-                    label = { Text(maneuver.text.ifBlank { maneuver.kind }, maxLines = 2) },-                    secondaryLabel = { Text("${maneuver.distanceFromStartM} m", maxLines = 1) },-                    colors = ChipDefaults.secondaryChipColors(),-                    modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp),-                )-            }-        }-        wearOpenOnPhoneItem(onClick = { scope.launch { WearLinkBridge.get(context).sendMessage("/maps/open-on-phone", ByteArray(0)) } }, icon = { IconMobileArrowRight(tint = androidx.compose.ui.graphics.Color.White) })-    }-}
maps/src/main/java/com/vayunmathur/maps/ui/WearSavedScreen.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/WearSavedScreen.kt b/maps/src/main/java/com/vayunmathur/maps/ui/WearSavedScreen.ktdeleted file mode 100644index 6f15bdd09d..0000000000--- a/maps/src/main/java/com/vayunmathur/maps/ui/WearSavedScreen.kt+++ /dev/null@@ -1,94 +0,0 @@-package com.vayunmathur.maps.ui-import com.vayunmathur.maps.sync.WearLinkBridge-import com.vayunmathur.library.wearlink.wearOpenOnPhoneItem-import com.vayunmathur.library.ui.IconMobileArrowRight-import androidx.compose.runtime.rememberCoroutineScope-import androidx.compose.ui.platform.LocalContext-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-import androidx.compose.runtime.Composable-import androidx.compose.runtime.collectAsState-import androidx.compose.runtime.getValue-import androidx.compose.ui.Modifier-import androidx.compose.ui.res.stringResource-import androidx.compose.ui.text.style.TextAlign-import androidx.compose.ui.unit.dp-import androidx.wear.compose.foundation.lazy.ScalingLazyColumn-import androidx.wear.compose.foundation.lazy.items-import androidx.wear.compose.foundation.lazy.rememberScalingLazyListState-import androidx.wear.compose.material.Chip-import androidx.wear.compose.material.ChipDefaults-import androidx.wear.compose.material.MaterialTheme-import androidx.wear.compose.material.Text-import com.vayunmathur.maps.R-import com.vayunmathur.maps.data.WearMapsStore-import com.vayunmathur.maps.domain.wearDistanceM--/**- * Saved places glance: name + distance from the user (phone position, or- * the region centre when no fix yet). The phone has no Home/Work concept- * and no watch ETA is invented — distance only.- */-@Composable-fun WearSavedScreen(-    store: WearMapsStore,-    onBack: () -> Unit,-) {-    val snapshot by store.snapshot.collectAsState()-    val position by store.position.collectAsState()-    WearSavedContent(snapshot = snapshot, position = position, onBack = onBack)-}--/** Stateless saved places behind [WearSavedScreen]: snapshot/position are parameters for previews. */-@Composable-internal fun WearSavedContent(snapshot: com.vayunmathur.library.wearlink.maps.WearMapSnapshot?, position: com.vayunmathur.library.wearlink.maps.WearPosition?, onBack: () -> Unit) {-    val listState = rememberScalingLazyListState()-    val context = LocalContext.current--    val scope = rememberCoroutineScope()--    ScalingLazyColumn(state = listState) {-        item {-            Text(-                stringResource(R.string.wear_saved),-                style = MaterialTheme.typography.title3,-                textAlign = TextAlign.Center,-                modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp),-            )-        }-        val places = snapshot?.saved.orEmpty()-        if (places.isEmpty()) {-            item {-                Text(-                    stringResource(R.string.wear_no_saved),-                    style = MaterialTheme.typography.body2,-                    textAlign = TextAlign.Center,-                    modifier = Modifier.fillMaxWidth().padding(horizontal = 12.dp),-                )-            }-        } else {-            val fromLat = position?.latE7 ?: snapshot!!.centerLatE7-            val fromLon = position?.lonE7 ?: snapshot!!.centerLonE7-            items(places) { place ->-                val meters = wearDistanceM(fromLat, fromLon, place)-                Chip(-                    onClick = {}, enabled = false,-                    label = { Text(place.name, maxLines = 1) },-                    secondaryLabel = {-                        Text(-                            if (meters >= 1000) "%.1f km".format(meters / 1000.0) else "${meters.toInt()} m",-                            maxLines = 1,-                        )-                    },-                    colors = ChipDefaults.secondaryChipColors(),-                    modifier = Modifier.fillMaxWidth().padding(horizontal = 8.dp),-                )-            }-        }-        wearOpenOnPhoneItem(onClick = { scope.launch { WearLinkBridge.get(context).sendMessage("/maps/open-on-phone", ByteArray(0)) } }, icon = { IconMobileArrowRight(tint = androidx.compose.ui.graphics.Color.White) })-    }-}
maps/src/main/res/values/wear_strings.xml
diff --git a/maps/src/main/res/values/wear_strings.xml b/maps/src/main/res/values/wear_strings.xmldeleted file mode 100644index f21a9cb8f1..0000000000--- a/maps/src/main/res/values/wear_strings.xml+++ /dev/null@@ -1,13 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<resources>-    <string name="wear_no_region">No map synced yet. Open Maps on your phone to sync this watch.</string>-    <string name="wear_stale">Stale · last map from your phone</string>-    <string name="wear_offline">Offline · showing the last map</string>-    <string name="wear_limited_detail">Road detail stays on your phone</string>-    <string name="wear_route">Route</string>-    <string name="wear_saved">Saved</string>-    <string name="wear_back">Back</string>-    <string name="wear_no_route">No route on your phone. Start navigation there and it appears here.</string>-    <string name="wear_no_saved">No saved places synced yet.</string>-    <string name="wear_maneuvers">Maneuvers</string>-</resources>