Skip to content
This repository was archived by the owner on Feb 5, 2021. It is now read-only.

Commit 240cbe7

Browse files
Merge pull request #31 from square/zachklipp/update-readme
Update README with dependency instructions for v0.29.0.
2 parents 55c4403 + 4c1c33b commit 240cbe7

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# workflow-kotlin-compose
22

3+
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
4+
[![Maven Central](https://img.shields.io/maven-central/v/com.squareup.workflow/workflow-ui-core-compose.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:com.squareup.workflow%20AND%20a:workflow-ui-core-compose)
5+
36
This module provides experimental support for [Jetpack Compose UI][1] with workflows.
47

58
The only integration that is currently supported is the ability to define [ViewFactories][2] that
@@ -20,8 +23,24 @@ and to experiment with various ways to integrate Compose with Workflow.
2023

2124
## Usage
2225

23-
To get started, you must be using the latest Android Gradle Plugin 4.x version. Then, you need to
24-
enable Compose support in your `build.gradle`:
26+
### Add the dependency
27+
28+
Add the dependencies from this project (they're on Maven Central):
29+
30+
```groovy
31+
dependencies {
32+
// Main dependency
33+
implementation "com.squareup.workflow:workflow-ui-core-compose:${versions.workflow_compose}"
34+
35+
// For the preview helpers
36+
implementation "com.squareup.workflow:workflow-ui-compose-tooling:${versions.workflow_compose}"
37+
}
38+
```
39+
40+
### Enable Compose
41+
42+
You must be using the latest Android Gradle Plugin 4.x version, and enable Compose support
43+
in your `build.gradle`:
2544

2645
```groovy
2746
android {
@@ -47,7 +66,7 @@ To create a `ViewFactory`, call `bindCompose`. The lambda passed to `bindCompose
4766
function.
4867

4968
```kotlin
50-
val HelloBinding = bindCompose<MyRendering> { rendering ->
69+
val HelloBinding = bindCompose<MyRendering> { rendering, _ ->
5170
MaterialTheme {
5271
Clickable(onClick = { rendering.onClick() }) {
5372
Text(rendering.message)

0 commit comments

Comments
 (0)