Modern Apps git

← Modern-Apps.git

weather: use loading indicator, shape tokens and emphasized type

Commit
51377c01c5c7961bd657500c738994a57a6fd63b
Author
vayun-mathur <[email protected]>
When
2026-08-21 18:37 UTC (3 months ago)
Parents
1f66de6

Diff

weather/src/main/java/com/vayunmathur/weather/ui/HomePage.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/HomePage.kt b/weather/src/main/java/com/vayunmathur/weather/ui/HomePage.ktindex b6563811f6..7dd1f9491a 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/HomePage.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/HomePage.kt@@ -22,6 +22,7 @@ import com.vayunmathur.library.ui.CircularProgressIndicator import com.vayunmathur.library.ui.DrawerState import com.vayunmathur.library.ui.DrawerValue import com.vayunmathur.library.ui.ExperimentalMaterial3Api+import com.vayunmathur.library.ui.LoadingIndicator import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.ModalDrawerSheet import com.vayunmathur.library.ui.ModalNavigationDrawer@@ -265,7 +266,7 @@ private fun ForecastColumn(                     if (error != null) {                         Text(error, color = MaterialTheme.colorScheme.error)                     } else {-                        CircularProgressIndicator()+                        LoadingIndicator()                     }                 }                 return@Column
weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt b/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.ktindex 6b8edd42c6..939fc3fde3 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt@@ -39,6 +39,7 @@ import com.vayunmathur.library.ui.IconButton import com.vayunmathur.library.ui.ListItem import com.vayunmathur.library.ui.ListItemDefaults import com.vayunmathur.library.ui.LazyListScaffold+import com.vayunmathur.library.ui.LoadingIndicator import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.ModalBottomSheet import com.vayunmathur.library.ui.Text@@ -491,7 +492,7 @@ fun SearchLocationPage(backStack: NavBackStack<Route>, viewModel: WeatherViewMod             Box(modifier = Modifier.fillMaxWidth().heightIn(min = 80.dp, max = 320.dp)) {                 when {                     searching && results.isEmpty() -> {-                        CircularProgressIndicator(modifier = Modifier.align(Alignment.Center))+                        LoadingIndicator(modifier = Modifier.align(Alignment.Center))                     }                     query.isNotBlank() && results.isEmpty() && !searching -> {                         Text(
weather/src/main/java/com/vayunmathur/weather/ui/WeatherMapPage.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/WeatherMapPage.kt b/weather/src/main/java/com/vayunmathur/weather/ui/WeatherMapPage.ktindex d6144afe2d..5475ca4f7c 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/WeatherMapPage.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/WeatherMapPage.kt@@ -341,7 +341,7 @@ fun WeatherMapPage(                 .navigationBarsPadding()                 .padding(12.dp),             color = MaterialTheme.colorScheme.surface.copy(alpha = 0.94f),-            shape = RoundedCornerShape(16.dp),+            shape = MaterialTheme.shapes.largeIncreased,             tonalElevation = 3.dp,         ) {             Column(modifier = Modifier.padding(16.dp)) {
weather/src/main/java/com/vayunmathur/weather/ui/components/CurrentWeatherCard.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/CurrentWeatherCard.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/CurrentWeatherCard.ktindex 513c1743e8..031361cbf8 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/CurrentWeatherCard.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/CurrentWeatherCard.kt@@ -62,8 +62,7 @@ fun CurrentWeatherCard(             Text(                 text = stringResource(condition.label),                 color = MaterialTheme.colorScheme.onSurface,-                style = MaterialTheme.typography.titleLarge,-                fontWeight = FontWeight.Medium,+                style = MaterialTheme.typography.titleLargeEmphasized,             )         }         Text(@@ -76,8 +75,7 @@ fun CurrentWeatherCard(             Text(                 text = stringResource(R.string.feels_like, formatTemperatureCompact(apparentTemperature, tempUnit)),                 color = MaterialTheme.colorScheme.onSurfaceVariant,-                style = MaterialTheme.typography.titleLarge,-                fontWeight = FontWeight.Medium,+                style = MaterialTheme.typography.titleLargeEmphasized,             )         }         Spacer(Modifier.height(6.dp))
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 bb489b0048..7338aec0ef 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@@ -6,7 +6,6 @@ import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape-import androidx.compose.foundation.shape.RoundedCornerShape import com.vayunmathur.library.ui.ExperimentalMaterial3Api import com.vayunmathur.library.ui.IconMyLocation import com.vayunmathur.library.ui.Icon@@ -53,7 +52,7 @@ fun LocationItem(     val contentColor =         if (isSelected) MaterialTheme.colorScheme.onPrimaryContainer         else MaterialTheme.colorScheme.onSurface-    val shape = if (isSelected) RoundedCornerShape(28.dp) else CircleShape+    val shape = if (isSelected) MaterialTheme.shapes.extraLarge else CircleShape      val condition = currentWeatherCode?.let { weatherConditionForCode(it) } ?: WeatherCondition.Unknown 
weather/src/main/java/com/vayunmathur/weather/ui/components/MetricGraphSheet.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/MetricGraphSheet.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/MetricGraphSheet.ktindex 5a6d15d0ba..bbb751a0cb 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/MetricGraphSheet.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/MetricGraphSheet.kt@@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.layout.Row-import androidx.compose.foundation.shape.RoundedCornerShape import com.vayunmathur.library.ui.ExperimentalMaterial3Api import com.vayunmathur.library.ui.IconMap import com.vayunmathur.library.ui.Icon@@ -207,7 +206,7 @@ fun MetricGraphSheet(                             .offset(x = clampedX)                             .widthIn(min = labelWidth),                         color = MaterialTheme.colorScheme.surfaceContainerHighest,-                        shape = RoundedCornerShape(8.dp),+                        shape = MaterialTheme.shapes.small,                         tonalElevation = 2.dp,                     ) {                         Column(
weather/src/main/java/com/vayunmathur/weather/ui/components/UseDeviceLocationCard.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/UseDeviceLocationCard.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/UseDeviceLocationCard.ktindex 560c64fd94..54a55d6727 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/UseDeviceLocationCard.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/UseDeviceLocationCard.kt@@ -4,13 +4,12 @@ import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape-import androidx.compose.foundation.shape.RoundedCornerShape-import com.vayunmathur.library.ui.CircularProgressIndicator import com.vayunmathur.library.ui.IconMyLocation import com.vayunmathur.library.ui.ExperimentalMaterial3Api import com.vayunmathur.library.ui.Icon import com.vayunmathur.library.ui.ListItem import com.vayunmathur.library.ui.ListItemDefaults+import com.vayunmathur.library.ui.LoadingIndicator import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.Surface import com.vayunmathur.library.ui.Text@@ -33,9 +32,9 @@ import androidx.compose.ui.res.stringResource @Composable fun UseDeviceLocationCard(onClick: () -> Unit, isLoading: Boolean = false) {     Surface(-        modifier = Modifier.clip(RoundedCornerShape(28.dp)),+        modifier = Modifier.clip(MaterialTheme.shapes.extraLarge),         onClick = onClick,-        shape = RoundedCornerShape(28.dp),+        shape = MaterialTheme.shapes.extraLarge,         color = MaterialTheme.colorScheme.surfaceBright,     ) {         ListItem(@@ -48,7 +47,7 @@ fun UseDeviceLocationCard(onClick: () -> Unit, isLoading: Boolean = false) {                     contentAlignment = Alignment.Center,                 ) {                     if (isLoading) {-                        CircularProgressIndicator(modifier = Modifier.size(24.dp))+                        LoadingIndicator(modifier = Modifier.size(24.dp))                     } else {                         IconMyLocation(                             tint = MaterialTheme.colorScheme.onSurface,
weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/AirQualityBlock.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/AirQualityBlock.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/AirQualityBlock.ktindex 710cd3cd1d..cf4b53a4c3 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/AirQualityBlock.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/AirQualityBlock.kt@@ -45,7 +45,7 @@ fun AirQualityBlock(air: AirQualityCurrent?) {                 modifier = Modifier.fillMaxWidth(),                 textAlign = TextAlign.End,                 color = MaterialTheme.colorScheme.onSurface,-                style = MaterialTheme.typography.displayMedium,+                style = MaterialTheme.typography.displayMediumEmphasized,             )             LinearProgressIndicator(                 progress = { progress },
weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/CloudCoverBlock.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/CloudCoverBlock.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/CloudCoverBlock.ktindex ff13c3aad7..8187005319 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/CloudCoverBlock.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/CloudCoverBlock.kt@@ -41,7 +41,7 @@ fun CloudCoverBlock(current: Current) {         }         Text(             text = "$pct%",-            style = MaterialTheme.typography.displayMedium,+            style = MaterialTheme.typography.displayMediumEmphasized,             modifier = Modifier.align(Alignment.Center).offset(y = 8.dp),             color = MaterialTheme.colorScheme.onSurface,         )
weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/HumidityBlock.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/HumidityBlock.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/HumidityBlock.ktindex 6d0eed05b9..c7279eabc0 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/HumidityBlock.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/HumidityBlock.kt@@ -58,7 +58,7 @@ fun HumidityBlock(current: Current, tempUnit: TemperatureUnit) {             modifier = Modifier                 .align(Alignment.CenterStart)                 .padding(horizontal = 12.dp),-            style = MaterialTheme.typography.displayMedium,+            style = MaterialTheme.typography.displayMediumEmphasized,             color = MaterialTheme.colorScheme.onSurface,         )         Box(Modifier.align(Alignment.BottomStart)) {
weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PollenBlock.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PollenBlock.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PollenBlock.ktindex d0c1c3341f..d9128cc19f 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PollenBlock.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PollenBlock.kt@@ -49,7 +49,7 @@ fun PollenBlock(air: AirQualityCurrent?) {         }         Text(             text = "$level/4",-            style = MaterialTheme.typography.displayMedium,+            style = MaterialTheme.typography.displayMediumEmphasized,             modifier = Modifier.align(Alignment.Center).offset(y = 4.dp),             color = MaterialTheme.colorScheme.onSurface,         )
weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PrecipitationBlock.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PrecipitationBlock.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PrecipitationBlock.ktindex da8d80f88e..1a8c847be4 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PrecipitationBlock.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PrecipitationBlock.kt@@ -51,7 +51,7 @@ fun PrecipitationBlock(             Column(horizontalAlignment = Alignment.CenterHorizontally) {                 Text(                     text = value,-                    style = MaterialTheme.typography.displayMedium,+                    style = MaterialTheme.typography.displayMediumEmphasized,                     color = MaterialTheme.colorScheme.onSurface,                     maxLines = 1,                 )
weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PressureBlock.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PressureBlock.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PressureBlock.ktindex 883d4f09f1..7750388d79 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PressureBlock.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/PressureBlock.kt@@ -72,7 +72,7 @@ fun PressureBlock(current: Current, pressureUnit: PressureUnit) {         }         Text(             text = valueText,-            style = MaterialTheme.typography.displaySmall,+            style = MaterialTheme.typography.displaySmallEmphasized,             modifier = Modifier.align(Alignment.Center).offset(y = 10.dp),             color = MaterialTheme.colorScheme.onSurface,         )
weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/UvIndexBlock.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/UvIndexBlock.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/UvIndexBlock.ktindex 4c9a571cb3..6666ae6a90 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/UvIndexBlock.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/UvIndexBlock.kt@@ -92,7 +92,7 @@ fun UvIndexBlock(uvIndex: Double?) {         }         Text(             text = v?.toString() ?: "—",-            style = MaterialTheme.typography.displayMedium,+            style = MaterialTheme.typography.displayMediumEmphasized,             modifier = Modifier.align(Alignment.Center).offset(y = 4.dp),             color = MaterialTheme.colorScheme.onSurface,         )
weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/VisibilityBlock.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/VisibilityBlock.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/VisibilityBlock.ktindex 1d2e01b273..3f6b58b613 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/VisibilityBlock.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/VisibilityBlock.kt@@ -47,7 +47,7 @@ fun VisibilityBlock(current: Current, useMiles: Boolean = false) {         }         Text(             text = value.toString(),-            style = MaterialTheme.typography.displayMedium,+            style = MaterialTheme.typography.displayMediumEmphasized,             modifier = Modifier.align(Alignment.Center).offset(y = 8.dp),             color = MaterialTheme.colorScheme.onSurface,         )
weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/WindBlock.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/WindBlock.kt b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/WindBlock.ktindex 5e407cdc7f..0892d53caf 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/WindBlock.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/components/blocks/WindBlock.kt@@ -55,7 +55,7 @@ fun WindBlock(current: Current, unit: WindUnit) {             Row(verticalAlignment = Alignment.Bottom) {                 Text(                     text = windText.substringBefore(' '),-                    style = MaterialTheme.typography.displayMedium,+                    style = MaterialTheme.typography.displayMediumEmphasized,                     modifier = Modifier.alignByBaseline(),                     color = MaterialTheme.colorScheme.onSurface,                     maxLines = 1,