From a7ea7b77676d960da905b1e2ff70f4ba5f800959 Mon Sep 17 00:00:00 2001 From: Oleksandr Karpovich Date: Mon, 10 Jan 2022 15:53:03 +0100 Subject: [PATCH] move Compose submodule and update mpp demo (#1678) Co-authored-by: Oleksandr Karpovich --- compose/frameworks/support | 2 +- .../src/commonMain/kotlin/fallingBalls/FallingBalls.kt | 8 ++------ examples/falling-balls-mpp/src/jsMain/kotlin/main.js.kt | 6 +----- .../falling-balls-mpp/src/macosMain/kotlin/main.macos.kt | 6 +----- .../falling-balls-mpp/src/uikitMain/kotlin/main.uikit.kt | 5 +---- 5 files changed, 6 insertions(+), 21 deletions(-) diff --git a/compose/frameworks/support b/compose/frameworks/support index 50a8603587..fe220467ab 160000 --- a/compose/frameworks/support +++ b/compose/frameworks/support @@ -1 +1 @@ -Subproject commit 50a86035871957ff062b5f4316475fcc8dc80fda +Subproject commit fe220467abcf2368966a051b732752513ffeceda diff --git a/examples/falling-balls-mpp/src/commonMain/kotlin/fallingBalls/FallingBalls.kt b/examples/falling-balls-mpp/src/commonMain/kotlin/fallingBalls/FallingBalls.kt index 716dd0a725..e3f444b01c 100644 --- a/examples/falling-balls-mpp/src/commonMain/kotlin/fallingBalls/FallingBalls.kt +++ b/examples/falling-balls-mpp/src/commonMain/kotlin/fallingBalls/FallingBalls.kt @@ -66,12 +66,8 @@ fun FallingBalls(game: Game) { .fillMaxHeight(1f) .onSizeChanged { with(density) { - if (org.jetbrains.skiko.kotlinBackend == KotlinBackend.JVM) { - // Really ugly hack, until we properly pass geometry. - // TODO: fix me in Compose. - game.width = it.width.toDp() - game.height = it.height.toDp() - } + game.width = it.width.toDp() + game.height = it.height.toDp() } } ) { diff --git a/examples/falling-balls-mpp/src/jsMain/kotlin/main.js.kt b/examples/falling-balls-mpp/src/jsMain/kotlin/main.js.kt index 811ece5aa1..3c5bf4425c 100644 --- a/examples/falling-balls-mpp/src/jsMain/kotlin/main.js.kt +++ b/examples/falling-balls-mpp/src/jsMain/kotlin/main.js.kt @@ -15,11 +15,7 @@ object JsTime : Time { fun main() { onWasmReady { Window("Falling Balls") { - val game = remember { Game(JsTime).apply { - // Ugly hack, properly pass geometry. - width = 800.dp - height = 800.dp - }} + val game = remember { Game(JsTime) } FallingBalls(game) } } diff --git a/examples/falling-balls-mpp/src/macosMain/kotlin/main.macos.kt b/examples/falling-balls-mpp/src/macosMain/kotlin/main.macos.kt index a8fd142c92..be803b013d 100644 --- a/examples/falling-balls-mpp/src/macosMain/kotlin/main.macos.kt +++ b/examples/falling-balls-mpp/src/macosMain/kotlin/main.macos.kt @@ -16,11 +16,7 @@ object MacosTime : Time { fun main() { NSApplication.sharedApplication() Window("Falling Balls") { - val game = remember { Game(MacosTime).apply { - // TODO: rework, now we do not properly propagate geometry changes. - width = 800.dp - height = 600.dp - } } + val game = remember { Game(MacosTime) } FallingBalls(game) } NSApp?.run() diff --git a/examples/falling-balls-mpp/src/uikitMain/kotlin/main.uikit.kt b/examples/falling-balls-mpp/src/uikitMain/kotlin/main.uikit.kt index 082b41477c..08dbed3d8a 100644 --- a/examples/falling-balls-mpp/src/uikitMain/kotlin/main.uikit.kt +++ b/examples/falling-balls-mpp/src/uikitMain/kotlin/main.uikit.kt @@ -45,10 +45,7 @@ class SkikoAppDelegate : UIResponder, UIApplicationDelegateProtocol { override fun application(application: UIApplication, didFinishLaunchingWithOptions: Map?): Boolean { window = UIWindow(frame = UIScreen.mainScreen.bounds) window!!.rootViewController = Application("Falling Balls") { - val game = remember { Game(UikitTime).apply { - width = 800.dp - height = 800.dp - } } + val game = remember { Game(UikitTime) } Column { // To skip upper part of screen. Box(modifier = Modifier