From db18acec0b0a7c1d39d63c77ef62fc3dd75d8e24 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Mon, 6 Nov 2023 08:59:48 +1000 Subject: [PATCH 1/2] Fix Tile previews --- WearTilesKotlin/app/build.gradle | 7 ++++--- WearTilesKotlin/gradle/libs.versions.toml | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/WearTilesKotlin/app/build.gradle b/WearTilesKotlin/app/build.gradle index 1b152462c..c3f7ec1ee 100644 --- a/WearTilesKotlin/app/build.gradle +++ b/WearTilesKotlin/app/build.gradle @@ -65,14 +65,15 @@ dependencies { implementation libs.androidx.datastore implementation libs.androidx.wear.tiles.material - implementation libs.androidx.wear.tooling.preview implementation libs.coil implementation libs.kotlinx.coroutines.android implementation libs.kotlinx.coroutines.guava - implementation libs.compose.ui.tooling.preview - implementation libs.horologist.compose.tools implementation libs.horologist.tiles + + implementation libs.androidx.wear.tooling.preview + implementation libs.compose.ui.tooling.preview + debugImplementation libs.androidx.ui.tooling } diff --git a/WearTilesKotlin/gradle/libs.versions.toml b/WearTilesKotlin/gradle/libs.versions.toml index ac0ba4901..30e9de37e 100644 --- a/WearTilesKotlin/gradle/libs.versions.toml +++ b/WearTilesKotlin/gradle/libs.versions.toml @@ -23,6 +23,7 @@ horologist-tiles = { module = "com.google.android.horologist:horologist-tiles", kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "org-jetbrains-kotlin" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "org-jetbrains-kotlinx" } kotlinx-coroutines-guava = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-guava", version.ref = "org-jetbrains-kotlinx" } +androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "compose" } [plugins] com-android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" } From e82a19873f44021c387b724d5ff67bc5da4777e5 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Mon, 6 Nov 2023 09:00:59 +1000 Subject: [PATCH 2/2] Fix Tile previews --- .../com/example/wear/tiles/messaging/MessagingTileLayout.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WearTilesKotlin/app/src/main/java/com/example/wear/tiles/messaging/MessagingTileLayout.kt b/WearTilesKotlin/app/src/main/java/com/example/wear/tiles/messaging/MessagingTileLayout.kt index cf3c7e9f8..8168917d6 100644 --- a/WearTilesKotlin/app/src/main/java/com/example/wear/tiles/messaging/MessagingTileLayout.kt +++ b/WearTilesKotlin/app/src/main/java/com/example/wear/tiles/messaging/MessagingTileLayout.kt @@ -29,6 +29,7 @@ import androidx.wear.protolayout.material.layouts.MultiButtonLayout import androidx.wear.protolayout.material.layouts.PrimaryLayout import com.example.wear.tiles.R import com.example.wear.tiles.tools.IconSizePreview +import com.example.wear.tiles.tools.WearLargeRoundDevicePreview import com.example.wear.tiles.tools.WearSmallRoundDevicePreview import com.example.wear.tiles.tools.emptyClickable import com.google.android.horologist.compose.tools.LayoutElementPreview @@ -98,6 +99,7 @@ private fun searchLayout( .build() @WearSmallRoundDevicePreview +@WearLargeRoundDevicePreview @Composable private fun MessageTilePreview() { val context = LocalContext.current