Modern Apps git

← Modern-Apps.git

weather: fix units button location

Commit
274ca9feffac04a33c0b0aaf2b40de2fcb42d7e4
Author
Vayun Mathur <[email protected]>
When
2026-08-09 19:31 UTC (3 months ago)
Parents
941bd50

Diff

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 fbc5c3a2ca..0bc413ea70 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt@@ -14,6 +14,7 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues+import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth@@ -34,7 +35,6 @@ import com.vayunmathur.library.ui.ExperimentalMaterial3Api import com.vayunmathur.library.ui.IconBack import com.vayunmathur.library.ui.IconDelete import com.vayunmathur.library.ui.IconDragHandle-import com.vayunmathur.library.ui.IconRuler import com.vayunmathur.library.ui.IconSearch import com.vayunmathur.library.ui.IconButton import com.vayunmathur.library.ui.ListItem@@ -260,24 +260,30 @@ fun LocationsScreen(                         IconBack(tint = MaterialTheme.colorScheme.onSurface)                     }                 },-                actions = {-                    val context = LocalContext.current-                    IconButton(onClick = { openRegionalUnitsSettings(context) }) {-                        IconRuler(tint = MaterialTheme.colorScheme.onSurface)-                    }-                },             )         },         bottomBar = {-            Button(-                onClick = onSearchLocation,+            val context = LocalContext.current+            Row(                 modifier = Modifier                     .fillMaxWidth()                     .padding(horizontal = 16.dp, vertical = 12.dp),+                horizontalArrangement = Arrangement.spacedBy(8.dp),             ) {-                IconSearch()-                Spacer(Modifier.width(8.dp))-                Text(stringResource(R.string.search_location))+                Button(+                    onClick = onSearchLocation,+                    modifier = Modifier.weight(1f),+                ) {+                    IconSearch()+                    Spacer(Modifier.width(8.dp))+                    Text(stringResource(R.string.search_location))+                }+                Button(+                    onClick = { openRegionalUnitsSettings(context) },+                    modifier = Modifier.weight(1f),+                ) {+                    Text(stringResource(R.string.set_units))+                }             }         },     ) { paddingValues ->
weather/src/main/res/values/strings.xml
diff --git a/weather/src/main/res/values/strings.xml b/weather/src/main/res/values/strings.xmlindex d1aa7a842f..79bf723b8e 100644--- a/weather/src/main/res/values/strings.xml+++ b/weather/src/main/res/values/strings.xml@@ -24,8 +24,8 @@      <!-- Section header title for locations drawer sheet. Noun plural -->     <string name="locations">Locations</string>-    <!-- Locations panel action: opens the OS regional units settings. Verb phrase -->-    <string name="set_units">Set units</string>+    <!-- Locations panel action: opens the OS regional units settings. Noun phrase -->+    <string name="set_units">Units</string>     <!-- Search dialog title and bottom bar button to open search. Verb phrase -->     <string name="search_location">Search location</string>     <!-- TextField placeholder/hint for entering city name. Noun phrase -->