Skip to content

Commit 457ced3

Browse files
committed
fix: use observable platformLocale to resolve NonObservableLocale lint errors
1 parent 0d562c7 commit 457ced3

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

maps-app/src/main/java/com/google/maps/android/compose/GroundOverlayActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ fun GroundOverlayControls(
156156
Text(text = "Visible", modifier = Modifier.weight(1f))
157157
Switch(checked = isVisible, onCheckedChange = onVisibilityChange)
158158
}
159-
Text(text = "Transparency: ${String.format(Locale.getDefault(), "%.2f", transparency)}")
159+
Text(text = "Transparency: ${String.format(androidx.compose.ui.text.intl.Locale.current.platformLocale, "%.2f", transparency)}")
160160
Slider(
161161
value = transparency,
162162
onValueChange = onTransparencyChange,

maps-app/src/main/java/com/google/maps/android/compose/markerexamples/MarkerClusteringActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ private fun CustomUiClustering(items: List<MyItem>) {
205205
clusterContent = { cluster ->
206206
CircleContent(
207207
modifier = Modifier.size(40.dp),
208-
text = "%,d".format(Locale.getDefault(), cluster.size),
208+
text = "%,d".format(androidx.compose.ui.text.intl.Locale.current.platformLocale, cluster.size),
209209
color = Color.Blue,
210210
)
211211
},
@@ -252,7 +252,7 @@ fun CustomRendererClustering(items: List<MyItem>) {
252252
clusterContent = { cluster ->
253253
CircleContent(
254254
modifier = Modifier.size(40.dp),
255-
text = "%,d".format(Locale.getDefault(), cluster.size),
255+
text = "%,d".format(androidx.compose.ui.text.intl.Locale.current.platformLocale, cluster.size),
256256
color = Color.Green,
257257
)
258258
},

0 commit comments

Comments
 (0)