Skip to content

Commit f49a5bf

Browse files
committed
CMP preview updates
1 parent c8aeb64 commit f49a5bf

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

common/build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ kotlin {
6363
implementation(compose.foundation)
6464
implementation(compose.material3)
6565
implementation(compose.components.resources)
66+
implementation(compose.components.uiToolingPreview)
6667
implementation(compose.materialIconsExtended)
6768
implementation(libs.compose.adaptive)
6869
implementation(libs.compose.adaptive.layout)
@@ -93,6 +94,10 @@ kotlin {
9394
}
9495
}
9596

97+
dependencies {
98+
debugImplementation(compose.uiTooling)
99+
}
100+
96101
kotlin {
97102
targets.configureEach {
98103
val isAndroidTarget = platformType == KotlinPlatformType.androidJvm

common/src/commonMain/kotlin/dev/johnoreilly/common/stationlist/StationListUI.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import dev.johnoreilly.common.remote.Station
3636
import dev.johnoreilly.common.remote.freeBikes
3737
import dev.johnoreilly.common.screens.StationListScreen
3838
import org.jetbrains.compose.resources.painterResource
39+
import org.jetbrains.compose.ui.tooling.preview.Preview
3940
import software.amazon.lastmile.kotlin.inject.anvil.AppScope
4041

4142
val lowAvailabilityColor = Color(0xFFFF8C00)
@@ -74,6 +75,16 @@ fun StationListContent(stationList: List<Station>) {
7475
}
7576
}
7677

78+
79+
@Preview
80+
@Composable
81+
fun StationViewtPreview() {
82+
StationView(
83+
Station("1", "Test Bike Station", 5, 20, 0.0, 0.0)
84+
)
85+
}
86+
87+
7788
@Composable
7889
fun StationView(station: Station) {
7990

0 commit comments

Comments
 (0)