From 200cb779e7217177bbda2109f2c7dc36e8cb8d18 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Mon, 5 Jul 2021 16:48:54 +0300 Subject: [PATCH] Add @Preview to Falling Balls demo --- examples/falling_balls/build.gradle.kts | 3 ++- examples/falling_balls/src/main/kotlin/Game.kt | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/falling_balls/build.gradle.kts b/examples/falling_balls/build.gradle.kts index e41dd7f372..6dc6cdb5c7 100644 --- a/examples/falling_balls/build.gradle.kts +++ b/examples/falling_balls/build.gradle.kts @@ -6,7 +6,7 @@ plugins { // __KOTLIN_COMPOSE_VERSION__ kotlin("jvm") version "1.5.10" // __LATEST_COMPOSE_RELEASE_VERSION__ - id("org.jetbrains.compose") version "0.4.0" + id("org.jetbrains.compose") version "0.5.0-build229" } group = "me.user" @@ -19,6 +19,7 @@ repositories { dependencies { implementation(compose.desktop.currentOs) + implementation(compose.uiTooling) } tasks.withType() { diff --git a/examples/falling_balls/src/main/kotlin/Game.kt b/examples/falling_balls/src/main/kotlin/Game.kt index ade43f44ef..9c40763681 100644 --- a/examples/falling_balls/src/main/kotlin/Game.kt +++ b/examples/falling_balls/src/main/kotlin/Game.kt @@ -1,5 +1,6 @@ package org.jetbrains.compose.demo.falling +import androidx.compose.desktop.ui.tooling.preview.Preview import androidx.compose.foundation.layout.* import androidx.compose.material.Button import androidx.compose.material.Slider @@ -72,6 +73,7 @@ class Game { } @Composable +@Preview fun FallingBallsGame() { val game = remember { Game() } val density = LocalDensity.current