weather: fix low contrast on selected location and daily forecast day
- Commit
7d2b64fb01dfaa818d7484ce7c159cf89de1139c- Author
- Vayun Mathur <[email protected]>
- When
- 2026-08-10 20:58 UTC (3 months ago)
- Parents
db7f97e
Diff
weather/src/main/java/com/vayunmathur/weather/ui/components/DailyCard.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/DailyCard.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/DailyCard.ktindex 997d29061d..72092db3e9 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/DailyCard.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/DailyCard.kt@@ -99,6 +99,9 @@ private fun DailyItem( shape = CircleShape, onClick = onClick, ) {+ val onColor = if (isSelected) MaterialTheme.colorScheme.onPrimaryContainer else MaterialTheme.colorScheme.onSurface+ val mutedColor = if (isSelected) MaterialTheme.colorScheme.onPrimaryContainer.copy(alpha = 0.8f) else MaterialTheme.colorScheme.onSurfaceVariant+ val accentColor = if (isSelected) MaterialTheme.colorScheme.onPrimaryContainer else MaterialTheme.colorScheme.primary Column( modifier = Modifier .heightIn(min = 210.dp)@@ -111,26 +114,26 @@ private fun DailyItem( Text( formatTemperatureCompact(maxTemp, tempUnit), style = MaterialTheme.typography.bodyLarge,- color = MaterialTheme.colorScheme.onSurface,+ color = onColor, ) Text( formatTemperatureCompact(minTemp, tempUnit), style = MaterialTheme.typography.bodyLarge,- color = MaterialTheme.colorScheme.onSurfaceVariant,+ color = mutedColor, ) } Column(horizontalAlignment = Alignment.CenterHorizontally) {- WeatherIconBox(icon = icon, size = 38.dp)+ WeatherIconBox(icon = icon, size = 38.dp, tint = onColor) Spacer(Modifier.height(8.dp)) Text( "${precipitationProbability}%",- color = MaterialTheme.colorScheme.primary,+ color = accentColor, style = MaterialTheme.typography.bodyMedium, ) Spacer(Modifier.height(4.dp)) Text( weekday,- color = MaterialTheme.colorScheme.onSurface,+ color = onColor, style = MaterialTheme.typography.bodyLarge, ) }
weather/src/main/java/com/vayunmathur/weather/ui/components/LocationItem.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/LocationItem.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/LocationItem.ktindex 403c86bb75..961a207ca5 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/LocationItem.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/LocationItem.kt@@ -76,7 +76,7 @@ fun LocationItem( WeatherIconBox( icon = condition.iconContent(isDay), size = 34.dp,- tint = contentColor,+ tint = MaterialTheme.colorScheme.onSurface, ) } },