GitHub - android/compose-samples: Official Jetpack Compose samples. (original) (raw)
Jetpack Compose Samples
This repository contains a set of individual Android Studio projects to help you learn about Compose in Android. Each sample demonstrates different use cases, complexity levels and APIs.
For more information, please read the documentation.
đź’» Requirements
To try out these sample apps, you need to use Android Studio. You can clone this repository or import the project from Android Studio following the stepshere.
🧬 Samples
Project | |
---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
🧬 Additional samples
Project | |
---|---|
![]() ![]() |
![]() |
![]() ![]() |
![]() |
High level features
Looking for a sample that has the following features?
Custom Layouts
- Jetnews: Interests Screen
- Jetchat: AnimatedFabContent
- Jetsnack: Grid
- Jetsnack: CollapsingImageLayout
Theming
Animations
Text
Large Screens
TV
Wear
Formatting
To automatically format all samples: Run ./scripts/format.sh
To check one sample for errors: Navigate to the sample folder and run ./gradlew --init-script buildscripts/init.gradle.kts spotlessCheck
To format one sample: Navigate to the sample folder and run ./gradlew --init-script buildscripts/init.gradle.kts spotlessApply
Updates
To update dependencies to their new stable versions, run:
To make any other manual updates to dependencies (ie add a new dependency or set an alpha version), update the /scripts/libs.versions.toml
file with changes, and then run duplicate_version_config.sh
to propogate the changes to all other samples. You can also update the toml-updater-config.gradle
file with changes that need to propogate to each sample.
Obsolete Sample Projects
Over time some of our samples become a little stale and are removed to keep the repository easy to navigate. If you are curious you can still find them in the history, however if you are new you might be better served sticking to the most up to date resources.
Project | Removed | Commit |
---|---|---|
Crane | 2024-08-02 | ee8e272 |
Owl | 2024-08-02 | ee8e272 |
Jetsurvey | 2024-08-02 | ee8e272 |
Rally | 2024-08-02 | ee8e272 |
License
Copyright 2024 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.