Skip to content
A quick demo of the new Jetpack Compose Maven binaries
Kotlin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
gradle/wrapper
.gitignore
LICENSE
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

Jetpack Demo (Deprecated)

This repo was a quick demo of the Jetpack Compose library, with the binaries being fetched from the then-newly discovered Maven links. Whilst it compiles and renders the Views, it's broken in subtle ways (such as observing @Models, which is half the point of Compose).

Since then, Google have updated their binaries and released full-featured IDE support, as well as in depth tutorials which can be found here. Please don't use this: I'm just keeping it up as a link from my blog.

I wrote about this here if you want to know more about how to get this setup yourself, or feel free to clone/fork this repo.

Example

@Composable
fun mainLayout() {
    val (text, setText) = +state { "Hello, World!" }
    MaterialTheme {
        Column(
            modifier = padding(8.dp),
            mainAxisAlignment = MainAxisAlignment.Center,
            crossAxisAlignment = CrossAxisAlignment.Center
        ) {
            Text(text = text, modifier = absolutePadding(bottom = 8.dp))
            Button(text = "Click me", onClick = { setText("Button Clicked!") })
        }
    }
}
You can’t perform that action at this time.