Dominaezzz

    Dominaezzz

    2 years ago
    Can compose be used on arbitrary trees now?
    shikasd

    shikasd

    2 years ago
    Yep, definitely Leland tweeted about it some time ago with an example: https://twitter.com/intelligibabble/status/1273339533891788800
    Dominaezzz

    Dominaezzz

    2 years ago
    I tried it but Android Studio couldn't find those classes.
    AbstractApplier
    shikasd

    shikasd

    2 years ago
    Maybe you don't have runtime connected as a dependency? I also did an experiment with having a custom tree on server representing client UIhttps://medium.com/@shikasd/composing-in-the-wild-145761ad62c3
    Dominaezzz

    Dominaezzz

    2 years ago
    I want to experiment with JavaFX and see how well they can play together.
    Did you get that working outside Android Studio?
    shikasd

    shikasd

    2 years ago
    yep, definitely I know that desktop variant of runtime is working with Swing as of now, so you could check that, I think
    Dominaezzz

    Dominaezzz

    2 years ago
    Woah! Swing has been done already?! Where can I find this?
    Dominaezzz

    Dominaezzz

    2 years ago
    Ah, interesting. Thanks!
    Chuck Jazdzewski [G]

    Chuck Jazdzewski [G]

    2 years ago
    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.
    Dominaezzz

    Dominaezzz

    2 years ago
    Will keep that in mind.
    I currently have this.
    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.
    shikasd

    shikasd

    2 years ago
    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?
    Dominaezzz

    Dominaezzz

    2 years ago
    oh, I didn't consider that.
    I just looked at the google maven repo and the artefact is
    .aar
    instead of
    .jar
    ..... rip.
    shikasd

    shikasd

    2 years ago
    Yeah, but the desktop one should be jar, no? Maybe it is not published at all, so consider building it yourself 🙂