Modern Apps git

← Modern-Apps.git

maps: remove colour overrides from place action row

Commit
de572f31cc0c24e52295d45178d2253c9a64de20
Author
Vayun Mathur <[email protected]>
When
2026-12-02 03:04 UTC (4 days ago)
Parents
f0150ef
The place details sheet's action row (PlaceActionRow) pinned its own
colours on every button: the Directions pill used a primary container
with onPrimary icon and label, the Save button tinted its icon primary
when saved and onSurface otherwise, and every sibling action (Call,
Website, Order, Share, Save) sat in a circular Surface with an explicit
surface colour and an outlineVariant border, with its label pinned to
onSurfaceVariant.

Remove all of those explicit colour overrides so the whole row uses
plain Material theme styling: the Directions pill and the sibling
circles now take the library Surface defaults, and the Directions,
Save and sibling icons and labels take the default content colour.
The now-unused border import is dropped and the Directions comment
updated to match.

Actions, layout, weights, labels and content descriptions are
unchanged; this is colours only. A sibling change making Directions
icon-only can build on this without colour conflicts.

Verified: :maps:testDevUnitTest green. :maps:lint (68 errors) and
:maps:lintVitalRelease (14 errors) fail on pre-existing errors in
untouched files (DialogAsRoute, FixtureDeterminism,
RouteScreenshotCoverage, ScaffoldSearch); the lint reports contain
no findings in PlaceActionRow.kt. No screenshot preview renders this
row, so no preview fixture needed updating.

Diff

maps/src/main/java/com/vayunmathur/maps/ui/PlaceActionRow.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/PlaceActionRow.kt b/maps/src/main/java/com/vayunmathur/maps/ui/PlaceActionRow.ktindex 4fae5be0b3..8314c1fe21 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/PlaceActionRow.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/PlaceActionRow.kt@@ -3,7 +3,6 @@ import com.vayunmathur.maps.data.string  import android.content.Context import android.content.Intent-import androidx.compose.foundation.border import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box@@ -56,11 +55,11 @@ internal fun PlaceActionRow(         horizontalArrangement = Arrangement.spacedBy(8.dp),         verticalAlignment = Alignment.CenterVertically,     ) {-        // Directions is the primary action: a filled pill, Google-Maps style,-        // rather than one more circular icon button in the row.+        // Directions is the primary action: a pill, Google-Maps style,+        // rather than one more circular icon button in the row. No colour+        // overrides: the whole row uses plain Material theme styling.         Surface(             shape = RoundedCornerShape(percent = 50),-            color = MaterialTheme.colorScheme.primary,             modifier = Modifier                 .weight(1.3f)                 .clip(RoundedCornerShape(percent = 50))@@ -71,11 +70,10 @@ internal fun PlaceActionRow(                 horizontalArrangement = Arrangement.Center,                 verticalAlignment = Alignment.CenterVertically,             ) {-                IconDirections(tint = MaterialTheme.colorScheme.onPrimary)+                IconDirections()                 Text(                     stringResource(if (inactiveNavigation == null) R.string.directions else R.string.add_stop_to_route),                     style = MaterialTheme.typography.labelLarge,-                    color = MaterialTheme.colorScheme.onPrimary,                     modifier = Modifier.padding(start = 6.dp),                 )             }@@ -101,7 +99,7 @@ internal fun PlaceActionRow(         }         PlaceAction(             Modifier.weight(1f),-            { IconSave(tint = if (isSaved) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onSurface) },+            { IconSave() },             stringResource(if (isSaved) UiR.string.saved else UiR.string.save),         ) {             if (isSaved) {@@ -130,17 +128,13 @@ private fun PlaceAction(     ) {         Surface(             shape = CircleShape,-            color = MaterialTheme.colorScheme.surface,-            modifier = Modifier-                .size(44.dp)-                .border(1.dp, MaterialTheme.colorScheme.outlineVariant, CircleShape),+            modifier = Modifier.size(44.dp),         ) {             Box(contentAlignment = Alignment.Center) { icon() }         }         Text(             label,             style = MaterialTheme.typography.labelSmall,-            color = MaterialTheme.colorScheme.onSurfaceVariant,         )     } }