maps: remove manual watch sync chip from wear map
- Commit
8c6f746acc9d30c43690a036c10d6e940d2ab53d- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-05 16:53 UTC (21 hours ago)
- Parents
af81ace
Phone-to-watch sync is now fully automatic over the Watch conduit, so the 'Update map' chip on the wear map is dead weight. Remove the chip, its result note, its onRequestRegion plumbing and the wear_request_region/wear_requested/wear_no_phone strings; the Route and Saved chips are kept. Update the wear preview and screenshot. Automatic WearMapsSync region/route publishing is unchanged. Verified: :maps:lint :maps:lintVitalRelease :maps:testDevUnitTest pass; :maps:metadata regenerated.
Diff
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 0cb6bdd566..b5588fa0ec 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/WearMapScreen.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/WearMapScreen.kt@@ -9,13 +9,9 @@ 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.mutableStateOf import androidx.compose.runtime.remember-import androidx.compose.runtime.rememberCoroutineScope-import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier-import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp@@ -26,8 +22,6 @@ import androidx.wear.compose.material.Text import com.vayunmathur.maps.R import com.vayunmathur.maps.data.WearMapsStore import com.vayunmathur.maps.domain.wearIsStale-import com.vayunmathur.maps.sync.WearLinkBridge-import kotlinx.coroutines.launch /** * Map home page: the rendered region with the user (and route, when the@@ -45,8 +39,7 @@ fun WearMapScreen( val route by store.route.collectAsState() val position by store.position.collectAsState() val connected by store.connected.collectAsState()- val context = LocalContext.current- WearMapContent(snapshot = snapshot, route = route, position = position, connected = connected, nowMillis = System.currentTimeMillis(), onOpenRoute = onOpenRoute, onOpenSaved = onOpenSaved, onRequestRegion = { WearLinkBridge.requestRegion(context) })+ WearMapContent(snapshot = snapshot, route = route, position = position, connected = connected, nowMillis = System.currentTimeMillis(), onOpenRoute = onOpenRoute, onOpenSaved = onOpenSaved) } /** Stateless map behind [WearMapScreen]: snapshot/route/position are parameters for previews. */@@ -59,12 +52,7 @@ internal fun WearMapContent( nowMillis: Long, onOpenRoute: () -> Unit, onOpenSaved: () -> Unit,- onRequestRegion: suspend () -> Boolean, ) {- val scope = rememberCoroutineScope()- var note by remember { mutableStateOf<String?>(null) }- val requestedText = stringResource(R.string.wear_requested)- val noPhoneText = stringResource(R.string.wear_no_phone) Box(Modifier.fillMaxSize()) { val current = snapshot@@ -131,14 +119,6 @@ internal fun WearMapContent( ) } }- note?.let {- Text(- it,- style = MaterialTheme.typography.caption2,- textAlign = TextAlign.Center,- modifier = Modifier.fillMaxWidth(),- )- } LazyRow { item { Chip(@@ -154,17 +134,6 @@ internal fun WearMapContent( colors = ChipDefaults.secondaryChipColors(), ) }- item {- Chip(- onClick = {- scope.launch {- note = if (onRequestRegion()) requestedText else noPhoneText- }- },- label = { Text(stringResource(R.string.wear_request_region), maxLines = 1) },- colors = ChipDefaults.primaryChipColors(),- )- } } } }
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.xmlindex 29ac7a7bb1..f21a9cb8f1 100644--- a/maps/src/main/res/values/wear_strings.xml+++ b/maps/src/main/res/values/wear_strings.xml@@ -4,9 +4,6 @@ <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_request_region">Update map</string>- <string name="wear_requested">Asked your phone for a fresh map</string>- <string name="wear_no_phone">Phone not reachable — showing the last map</string> <string name="wear_route">Route</string> <string name="wear_saved">Saved</string> <string name="wear_back">Back</string>
maps/src/screenshotTest/kotlin/com/vayunmathur/maps/ui/WearMetadataPreviews.kt
diff --git a/maps/src/screenshotTest/kotlin/com/vayunmathur/maps/ui/WearMetadataPreviews.kt b/maps/src/screenshotTest/kotlin/com/vayunmathur/maps/ui/WearMetadataPreviews.ktindex 47cc7c54b2..8519df4f4e 100644--- a/maps/src/screenshotTest/kotlin/com/vayunmathur/maps/ui/WearMetadataPreviews.kt+++ b/maps/src/screenshotTest/kotlin/com/vayunmathur/maps/ui/WearMetadataPreviews.kt@@ -67,7 +67,7 @@ class WearMetadataPreviews { @Composable fun Preview1MapRound() { RoundPreview {- WearMapContent(snapshot = fixtureSnapshot, route = fixtureRoute, position = WearPosition(latE7 = 525200000, lonE7 = 134050000, bearingDeg = 90), connected = true, nowMillis = FIXED_NOW_MILLIS, onOpenRoute = {}, onOpenSaved = {}, onRequestRegion = { true })+ WearMapContent(snapshot = fixtureSnapshot, route = fixtureRoute, position = WearPosition(latE7 = 525200000, lonE7 = 134050000, bearingDeg = 90), connected = true, nowMillis = FIXED_NOW_MILLIS, onOpenRoute = {}, onOpenSaved = {}) } }
metadata_data/photos/maps/wear/1.png
diff --git a/metadata_data/photos/maps/wear/1.png b/metadata_data/photos/maps/wear/1.pngindex 0c1f04ac21..ec08f55fa7 100644Binary files a/metadata_data/photos/maps/wear/1.png and b/metadata_data/photos/maps/wear/1.png differ