Skip to content

Commit 861d80a

Browse files
eriedclaude
andcommitted
Watch: smaller details header, speed unit grey to match dashboard
The wheel-name header on the second page was sized as a heading and competed visually with the speed below it. Shrunk to the same caption scale as the dashboard's km/h label so the speed reads as the visual focus instead. Speed in details now splits the number from the unit so the colours can diverge: number wears the same tier / accent colour as the dial, 'km/h' or 'mph' renders in the muted grey the dashboard already uses for its unit label. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3495f34 commit 861d80a

1 file changed

Lines changed: 24 additions & 10 deletions

File tree

  • wear/src/main/java/com/eried/eucplanet/wear/ui

wear/src/main/java/com/eried/eucplanet/wear/ui/WatchApp.kt

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,12 @@ private fun DetailsScreen(state: WatchState, accent: Color) {
443443
val sw = maxWidth.value
444444
val labelSp = (sw * 0.034f).coerceIn(10f, 13f).sp
445445
val valueSp = (sw * 0.038f).coerceIn(11f, 14f).sp
446-
val headerSp = (sw * 0.040f).coerceIn(12f, 15f).sp
446+
// Header (wheel name / "Disconnected") is meant to be a quiet caption,
447+
// not a heading — it shrinks under the speed which carries the visual
448+
// weight on this page.
449+
val headerSp = (sw * 0.030f).coerceIn(9f, 12f).sp
447450
val speedSp = (sw * 0.060f).coerceIn(18f, 26f).sp
451+
val speedUnitSp = (sw * 0.030f).coerceIn(9f, 12f).sp
448452
val labelWidth = (sw * 0.22f).coerceIn(60f, 90f).dp
449453
val valueWidth = (sw * 0.28f).coerceIn(75f, 110f).dp
450454

@@ -482,17 +486,27 @@ private fun DetailsScreen(state: WatchState, accent: Color) {
482486
fontWeight = FontWeight.SemiBold
483487
)
484488
}
485-
// Same accent rule as the dial: default accent → tier-coloured
486-
// speed (green/yellow/orange/red) so the second screen matches
487-
// the phone dashboard; any custom accent → wear that accent.
489+
// Speed number colours per main-screen rules; the km/h unit
490+
// stays the muted grey from the dashboard's small label.
488491
val useAccent = state.accentKey != "default"
489492
val detailMaxSpeed = if (state.maxSpeedKmh > 0f) state.maxSpeedKmh else 70f
490-
Text(
491-
text = "%.0f %s".format(speedDisplay, speedUnit),
492-
fontSize = speedSp,
493-
fontWeight = FontWeight.Bold,
494-
color = if (useAccent) accent else speedTierColor(state.speedKmh, detailMaxSpeed)
495-
)
493+
val speedColor = if (useAccent) accent else speedTierColor(state.speedKmh, detailMaxSpeed)
494+
Row(verticalAlignment = Alignment.Bottom) {
495+
Text(
496+
text = "%.0f".format(speedDisplay),
497+
fontSize = speedSp,
498+
fontWeight = FontWeight.Bold,
499+
color = speedColor
500+
)
501+
Spacer(Modifier.width(4.dp))
502+
Text(
503+
text = speedUnit,
504+
fontSize = speedUnitSp,
505+
fontWeight = FontWeight.Medium,
506+
color = Color(0xFF9AA0A6),
507+
modifier = Modifier.padding(bottom = (speedSp.value * 0.18f).dp)
508+
)
509+
}
496510
Spacer(Modifier.height(4.dp))
497511
val live = state.connected
498512
// Per-metric coloring on default accent mirrors the phone

0 commit comments

Comments
 (0)