Skip to content

Commit 451fac7

Browse files
committed
chore: added test for DisappearingScaleBar
1 parent dfd11ba commit 451fac7

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
2.77 KB
Loading

app/src/screenshotTest/java/com/google/maps/android/compose/ScaleBarTest.kt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import androidx.compose.ui.unit.dp
99
import com.google.android.gms.maps.model.CameraPosition
1010
import com.google.android.gms.maps.model.LatLng
1111
import com.google.maps.android.compose.theme.MapsComposeSampleTheme
12+
import com.google.maps.android.compose.widgets.DisappearingScaleBar
1213
import com.google.maps.android.compose.widgets.ScaleBar
1314

1415

@@ -34,4 +35,26 @@ class ScaleBarTest() {
3435
)
3536
}
3637
}
38+
39+
@Preview
40+
@Composable
41+
fun PreviewDisappearingScaleBar() {
42+
val cameraPositionState = remember {
43+
CameraPositionState(
44+
position = CameraPosition(
45+
LatLng(48.137154, 11.576124), // Example coordinates: Munich, Germany
46+
12f,
47+
0f,
48+
0f
49+
)
50+
)
51+
}
52+
53+
MapsComposeSampleTheme {
54+
DisappearingScaleBar(
55+
modifier = Modifier.padding(end = 4.dp),
56+
cameraPositionState = cameraPositionState
57+
)
58+
}
59+
}
3760
}

0 commit comments

Comments
 (0)