Louis Pullen-Freilich | 4e59c69 | 2020-10-26 18:03:32 +0000 | [diff] [blame] | 1 | # Jetpack Compose |
| 2 | ## Intro |
| 3 | Jetpack Compose is a suite of libraries within the AndroidX ecosystem. For more information, see our [project page](https://developer.android.com/jetpackcompose) |
Jim S | 3a6490c | 2019-05-07 14:10:46 -0700 | [diff] [blame] | 4 | |
Louis Pullen-Freilich | 4e59c69 | 2020-10-26 18:03:32 +0000 | [diff] [blame] | 5 | ## Syntax |
| 6 | Jetpack Compose uses composable functions instead of XML layouts to define UI components. You can |
| 7 | see this in action in the demos, like `androidx.compose.material.demos.ButtonDemo.kt`. More |
Alan Viverette | 053e7e6 | 2020-12-15 10:22:06 -0500 | [diff] [blame] | 8 | information can be found in the [compiler README](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/compiler/README.md). |
Jim S | 3a6490c | 2019-05-07 14:10:46 -0700 | [diff] [blame] | 9 | |
Louis Pullen-Freilich | 4e59c69 | 2020-10-26 18:03:32 +0000 | [diff] [blame] | 10 | ## Compiler |
| 11 | Composable functions are built using a custom Kotlin compiler plugin. More information about the |
Alan Viverette | 053e7e6 | 2020-12-15 10:22:06 -0500 | [diff] [blame] | 12 | compiler plugin is available in [this README](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/compiler/README.md). |
Jim S | 3a6490c | 2019-05-07 14:10:46 -0700 | [diff] [blame] | 13 | |
Louis Pullen-Freilich | 4e59c69 | 2020-10-26 18:03:32 +0000 | [diff] [blame] | 14 | ## Getting started |
Alan Viverette | 053e7e6 | 2020-12-15 10:22:06 -0500 | [diff] [blame] | 15 | To try out Jetpack Compose you need to set up the toolchain for AndroidX development. Follow the process [here](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/README.md) to check out the code. |
Jim S | 3a6490c | 2019-05-07 14:10:46 -0700 | [diff] [blame] | 16 | |
Louis Pullen-Freilich | 4e59c69 | 2020-10-26 18:03:32 +0000 | [diff] [blame] | 17 | To start the required version of Android Studio, you need to run the `ANDROIDX_PROJECTS=COMPOSE ./gradlew studio` |
Jim S | 3a6490c | 2019-05-07 14:10:46 -0700 | [diff] [blame] | 18 | |
Louis Pullen-Freilich | 4e59c69 | 2020-10-26 18:03:32 +0000 | [diff] [blame] | 19 | cd path/to/checkout/frameworks/support/ |
| 20 | ANDROIDX_PROJECTS=COMPOSE ./gradlew studio |
Jim S | 3a6490c | 2019-05-07 14:10:46 -0700 | [diff] [blame] | 21 | |
Louis Pullen-Freilich | 4e59c69 | 2020-10-26 18:03:32 +0000 | [diff] [blame] | 22 | Also if you would like to build from the command line, all gradle commands need to be run from the |
| 23 | `frameworks/support` folder. E.g. to build the demo app, run: |
Jim S | 3a6490c | 2019-05-07 14:10:46 -0700 | [diff] [blame] | 24 | |
Louis Pullen-Freilich | 4e59c69 | 2020-10-26 18:03:32 +0000 | [diff] [blame] | 25 | cd path/to/checkout/frameworks/support/ |
| 26 | ./gradlew :compose:integration-tests:demos:installDebug |
| 27 | |
Louis Pullen-Freilich | 4e59c69 | 2020-10-26 18:03:32 +0000 | [diff] [blame] | 28 | ## Structure |
Louis Pullen-Freilich | c5590fb | 2021-03-12 17:09:05 +0000 | [diff] [blame] | 29 | Library code for Jetpack Compose lives under the `frameworks/support/compose` directory. Additionally, sample code can be found within each module in the `integration-tests` subdirectories. Run the `demos` app to see examples of components and behavior. |
| 30 | |
| 31 | ## Guidance and documentation |
| 32 | |
| 33 | [Get started with Jetpack Compose](https://goo.gle/compose-docs) |
| 34 | |
| 35 | [Samples](https://goo.gle/compose-samples) |
| 36 | |
| 37 | [Pathway course](https://goo.gle/compose-pathway) |
Jim S | 3a6490c | 2019-05-07 14:10:46 -0700 | [diff] [blame] | 38 | |
Louis Pullen-Freilich | 14ccfcb | 2019-05-08 16:47:38 +0100 | [diff] [blame] | 39 | ## Feedback |
Alan Viverette | 053e7e6 | 2020-12-15 10:22:06 -0500 | [diff] [blame] | 40 | To provide feedback or report bugs, please refer to the main [AndroidX contribution guide](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/README.md) and report your bugs [here](https://issuetracker.google.com/issues/new?component=612128) |
Jim S | 3a6490c | 2019-05-07 14:10:46 -0700 | [diff] [blame] | 41 | |
Louis Pullen-Freilich | 4e59c69 | 2020-10-26 18:03:32 +0000 | [diff] [blame] | 42 | [Release notes](https://developer.android.com/jetpack/androidx/releases/compose) |
Jim S | 3a6490c | 2019-05-07 14:10:46 -0700 | [diff] [blame] | 43 | |
Alan Viverette | 053e7e6 | 2020-12-15 10:22:06 -0500 | [diff] [blame] | 44 | [Browse source](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/) |
Louis Pullen-Freilich | 4e59c69 | 2020-10-26 18:03:32 +0000 | [diff] [blame] | 45 | |
| 46 | [Existing open bugs](https://issuetracker.google.com/issues?q=componentid:612128%20status:open) |
| 47 | |
| 48 | [File a new bug](https://issuetracker.google.com/issues/new?component=612128) |
Louis Pullen-Freilich | c5590fb | 2021-03-12 17:09:05 +0000 | [diff] [blame] | 49 | |
| 50 | [Slack](https://goo.gle/compose-slack) |