https://kotlinlang.org logo
#compose
Title
# compose
d

Dominaezzz

08/06/2020, 3:45 PM
Can compose be used on arbitrary trees now?
s

shikasd

08/06/2020, 3:52 PM
Yep, definitely Leland tweeted about it some time ago with an example: https://twitter.com/intelligibabble/status/1273339533891788800
d

Dominaezzz

08/06/2020, 3:53 PM
I tried it but Android Studio couldn't find those classes.
AbstractApplier
s

shikasd

08/06/2020, 3:54 PM
Maybe you don't have runtime connected as a dependency? I also did an experiment with having a custom tree on server representing client UI https://medium.com/@shikasd/composing-in-the-wild-145761ad62c3
d

Dominaezzz

08/06/2020, 4:03 PM
I want to experiment with JavaFX and see how well they can play together.
Did you get that working outside Android Studio?
s

shikasd

08/06/2020, 4:15 PM
yep, definitely I know that desktop variant of runtime is working with Swing as of now, so you could check that, I think
d

Dominaezzz

08/06/2020, 4:16 PM
Woah! Swing has been done already?! Where can I find this?
d

Dominaezzz

08/06/2020, 4:20 PM
Ah, interesting. Thanks!
c

Chuck Jazdzewski [G]

08/06/2020, 4:43 PM
A note for JavaFX is that the composer is not multi-thread-safe yet. That is only one composition can be running at a time so you are limited to safely performing the compositions on the main thread. This is changing but is a limitation for at least until dev18.
👍 2
d

Dominaezzz

08/06/2020, 4:44 PM
Will keep that in mind.
I currently have this.
Copy code
repositories {
    google()
    mavenCentral()
    jcenter()
    maven("<https://dl.bintray.com/kotlin/kotlin-eap>")
}

val composeVersion = "0.1.0-dev16"

dependencies {
    implementation("androidx.compose.runtime:runtime:$composeVersion")
    implementation("androidx.compose.runtime:runtime-dispatch:$composeVersion")

//    implementation("androidx.compose:compose-runtime:$composeVersion")
//    implementation("androidx.compose:compose-dispatch:$composeVersion")

    kotlinCompilerPluginClasspath("androidx.compose:compose-compiler:$composeVersion")

    testImplementation(kotlin("test-junit"))
}
But the compose dependencies are not being resolved.
s

shikasd

08/08/2020, 4:12 PM
Hey, I imagine the difference here is that compose is published as a
desktop
flavour of mpp, so maybe you'll have to match this when consuming deps?
d

Dominaezzz

08/08/2020, 5:16 PM
oh, I didn't consider that.
I just looked at the google maven repo and the artefact is
.aar
instead of
.jar
..... rip.
s

shikasd

08/09/2020, 5:17 AM
Yeah, but the desktop one should be jar, no? Maybe it is not published at all, so consider building it yourself 🙂
6 Views