Browse Source

Add @Preview to Falling Balls demo

pull/845/head
Nikolay Igotti 4 years ago
parent
commit
200cb779e7
  1. 3
      examples/falling_balls/build.gradle.kts
  2. 2
      examples/falling_balls/src/main/kotlin/Game.kt

3
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<KotlinCompile>() {

2
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

Loading…
Cancel
Save