{"id":13404278,"url":"https://github.com/android/compose-samples","last_synced_at":"2025-05-12T05:26:06.729Z","repository":{"id":37270495,"uuid":"211288349","full_name":"android/compose-samples","owner":"android","description":"Official Jetpack Compose samples.","archived":false,"fork":false,"pushed_at":"2025-05-08T13:28:05.000Z","size":196600,"stargazers_count":21469,"open_issues_count":13,"forks_count":5044,"subscribers_count":426,"default_branch":"main","last_synced_at":"2025-05-12T02:41:53.261Z","etag":null,"topics":["android","jetpack-compose"],"latest_commit_sha":null,"homepage":"https://developer.android.com/jetpack/compose","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/android.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-27T09:51:19.000Z","updated_at":"2025-05-12T02:14:47.000Z","dependencies_parsed_at":"2022-08-08T20:00:42.132Z","dependency_job_id":"f3807304-e4ed-4d40-9b2a-adacc2f74435","html_url":"https://github.com/android/compose-samples","commit_stats":null,"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android%2Fcompose-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android%2Fcompose-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android%2Fcompose-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android%2Fcompose-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/android","download_url":"https://codeload.github.com/android/compose-samples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672700,"owners_count":21945480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","jetpack-compose"],"created_at":"2024-07-30T19:01:42.103Z","updated_at":"2025-05-12T05:26:06.705Z","avatar_url":"https://github.com/android.png","language":"Kotlin","readme":"# Jetpack Compose Samples\n\u003cimg src=\"readme/samples_montage.gif\" alt=\"Jetpack Compose Samples\" width=\"824\" /\u003e\n\nThis repository contains a set of individual Android Studio projects to help you learn about\nCompose in Android. Each sample demonstrates different use cases, complexity levels and APIs.\n\nFor more information, please [read the documentation](https://developer.android.com/jetpack/compose).\n\n💻 Requirements\n------------\nTo try out these sample apps, you need to use [Android Studio](https://developer.android.com/studio).\nYou can clone this repository or import the\nproject from Android Studio following the steps\n[here](https://developer.android.com/jetpack/compose/setup#sample).\n\n🧬 Samples\n------------\n\n| Project | |\n|:-----|---------|\n|  \u003cbr\u003e\u003cimg src=\"readme/jetnews.png\" alt=\"JetNews\" width=\"240\"\u003e\u003c/img\u003e \u003cbr\u003e\u003cbr\u003e A sample blog post viewer that demonstrates the use of Compose with a typical Material app and real-world architecture. \u003cbr\u003e\u003cbr\u003e • Medium complexity\u003cbr\u003e• Varied UI\u003cbr\u003e• Light \u0026 dark themes\u003cbr\u003e• Resource loading\u003cbr\u003e• UI Testing \u003cbr\u003e\u003cbr\u003e **[\u003e Browse](JetNews/)**\u003cbr\u003e\u003cbr\u003e | \u003cimg src=\"readme/screenshots/JetNews.png\" width=\"320\" alt=\"Jetnews sample demo\"\u003e |\n|  |  |\n|  \u003cbr\u003e\u003cimg src=\"readme/jetchat.png\" alt=\"Jetchat\" width=\"240\"\u003e\u003c/img\u003e \u003cbr\u003e\u003cbr\u003eA sample chat app that focuses on UI state patterns and text input.\u003cbr\u003e\u003cbr\u003e• Low complexity\u003cbr\u003e• Material Design 3 theme and Material You dynamic color\u003cbr\u003e• Resource loading\u003cbr\u003e• Back button handling\u003cbr\u003e• Integration with Architecture Components: Navigation, Fragments, LiveData, ViewModel\u003cbr\u003e• Animation\u003cbr\u003e• UI Testing\u003cbr\u003e\u003cbr\u003e**[\u003e Browse](Jetchat/)** \u003cbr\u003e\u003cbr\u003e | \u003cimg src=\"readme/screenshots/Jetchat.png\" width=\"320\" alt=\"Jetchat sample demo\"\u003e|\n|  |  |\n| \u003cbr\u003e\u003cimg src=\"readme/jetsnack.png\" alt=\"Jetsnack\" width=\"240\"\u003e\u003c/img\u003e \u003cbr\u003e\u003cbr\u003eJetsnack is a sample snack ordering app built with Compose.\u003cbr\u003e\u003cbr\u003e• Medium complexity\u003cbr\u003e• Custom design system\u003cbr\u003e• Custom layouts\u003cbr\u003e• Animation\u003cbr\u003e\u003cbr\u003e**[\u003e Browse](Jetsnack/)** \u003cbr\u003e\u003cbr\u003e  | \u003cimg src=\"readme/screenshots/Jetsnack.png\" width=\"320\" alt=\"Jetsnack sample demo\"\u003e|\n|  |  |\n| \u003cbr\u003e\u003cimg src=\"readme/jetcaster.png\" alt=\"Jetcaster\" width=\"240\"\u003e\u003c/img\u003e \u003cbr\u003e\u003cbr\u003eA sample podcast app that features a full-featured, Redux-style architecture and showcases dynamic themes.\u003cbr\u003e\u003cbr\u003e• Advanced sample\u003cbr\u003e• Dynamic theming using podcast artwork\u003cbr\u003e• Image fetching\u003cbr\u003e• [`WindowInsets`](https://developer.android.com/reference/kotlin/android/view/WindowInsets) support\u003cbr\u003e• Coroutines\u003cbr\u003e• Local storage with Room\u003cbr\u003e\u003cbr\u003e**[\u003e Browse](Jetcaster/)** \u003cbr\u003e\u003cbr\u003e  | \u003cimg src=\"readme/screenshots/Jetcaster.png\" width=\"320\" alt=\"Jetcaster sample demo\"\u003e|\n|  |  |\n| \u003cbr\u003e\u003cimg src=\"readme/reply.png\" alt=\"Reply\" width=\"240\"\u003e\u003c/img\u003e  \u003cbr\u003e\u003cbr\u003eA compose implementation of the Reply material study, an email client app that focuses on adaptive design for mobile, tablets and foldables. It also showcases brand new Material design 3 theming, dynamic colors and navigation components.\u003cbr\u003e\u003cbr\u003e• Medium complexity\u003cbr\u003e• Adaptive UI for phones, tablet and desktops\u003cbr\u003e• Foldable support\u003cbr\u003e• Material 3 theming \u0026 Components\u003cbr\u003e• Dynamic colors and Light/Dark theme support\u003cbr\u003e\u003cbr\u003e**[\u003e Browse](Reply/)** \u003cbr\u003e\u003cbr\u003e  | \u003cimg src=\"readme/screenshots/Reply.png\" width=\"320\" alt=\"Reply sample demo\"\u003e|\n|  |  |\n| \u003cbr\u003e\u003cimg src=\"readme/jetlagged_heading.png\" alt=\"JetLagged\" width=\"240\"\u003e\u003c/img\u003e  \u003cbr\u003e\u003cbr\u003eA sample sleep tracker app, showcasing how to create custom layouts and graphics in Compose\u003cbr\u003e\u003cbr\u003e• Custom Layouts\u003cbr\u003e• Graphs with Paths\u003cbr\u003e\u003cbr\u003e**[\u003e Browse](JetLagged/)** \u003cbr\u003e\u003cbr\u003e  | \u003cimg src=\"JetLagged/screenshots/JetLagged_Full.png\" width=\"320\" alt=\"JetLagged sample demo\"\u003e|\n\n🧬 Additional samples\n------------\n\n| Project | |\n|:-----|---------|\n| \u003cbr\u003e\u003cimg src=\"readme/nia.png\" alt=\"Now in Android\" width=\"240\"\u003e\u003c/img\u003e  \u003cbr\u003e\u003cbr\u003eAn app for keeping up to date with the latest news and developments in Android.\u003cbr\u003e\u003cbr\u003e• [Jetpack Compose](https://developer.android.com/jetpack/compose) first app.\u003cbr\u003e• Implements the recommended Android [Architecture Guidelines](https://developer.android.com/topic/architecture) \u003cbr\u003e• Integrates [Jetpack Libraries](https://developer.android.com/jetpack) holistically in the context of a real world app\u003cbr\u003e\u003cbr\u003e\u003ca href=\"https://play.google.com/store/apps/details?id=com.google.samples.apps.nowinandroid\"\u003e\u003cimg src=\"https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png\" height=\"70\"\u003e\u003c/a\u003e\u003cbr\u003e**[\u003e Browse](https://github.com/android/nowinandroid)** \u003cbr\u003e\u003cbr\u003e  | \u003cimg src=\"readme/screenshots/NiA.png\" width=\"320\" alt=\"Now In Android Github Repository\"\u003e|\n|  |  |\n| \u003cbr\u003e\u003cimg src=\"readme/material_catalog.png\" alt=\"Material Catalog\" width=\"240\"\u003e\u003c/img\u003e  \u003cbr\u003e\u003cbr\u003eA catalog of Material Design components and features available in Jetpack Compose. See how to implement them and how they look and behave on real devices.\u003cbr\u003e\u003cbr\u003e• Lives in AOSP—always up to date\u003cbr\u003e• Uses the same samples as API reference docs\u003cbr\u003e• Theme picker to change Material Theming values at runtime\u003cbr\u003e• Links to guidelines, docs, source code, and issue tracker\u003cbr\u003e\u003cbr\u003e\u003ca href=\"https://play.google.com/store/apps/details?id=androidx.compose.material.catalog\"\u003e\u003cimg src=\"https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png\" height=\"70\"\u003e\u003c/a\u003e\u003cbr\u003e**[\u003e Browse on AOSP](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/integration-tests/material-catalog)** \u003cbr\u003e\u003cbr\u003e  | \u003cimg src=\"readme/screenshots/Material_Catalog.png\" width=\"320\" alt=\"Material Catalog sample demo\"\u003e|\n\n\n## High level features \n\nLooking for a sample that has the following features?\n\n### Custom Layouts\n* [Jetnews: Interests Screen](https://github.com/android/compose-samples/blob/ee198110d8a7575da281de9bd0f84e91970468ca/JetNews/app/src/main/java/com/example/jetnews/ui/interests/InterestsScreen.kt#L428)\n* [Jetchat: AnimatedFabContent](https://github.com/android/compose-samples/blob/ee198110d8a7575da281de9bd0f84e91970468ca/Jetchat/app/src/main/java/com/example/compose/jetchat/components/AnimatingFabContent.kt#L101)\n* [Jetsnack: Grid](https://github.com/android/compose-samples/blob/73d7f25815e6936e0e815ce975905a6f10744c36/Jetsnack/app/src/main/java/com/example/jetsnack/ui/components/Grid.kt#L27)\n* [Jetsnack: CollapsingImageLayout](https://github.com/android/compose-samples/blob/main/Jetsnack/app/src/main/java/com/example/jetsnack/ui/snackdetail/SnackDetail.kt)\n\n### Theming\n* [Jetchat: Material3](https://github.com/android/compose-samples/blob/main/Jetchat/app/src/main/java/com/example/compose/jetchat/theme/Themes.kt#L91)\n* [Jetcaster: Custom theme based on cover art](https://github.com/android/compose-samples/blob/main/Jetcaster/app/src/main/java/com/example/jetcaster/util/DynamicTheming.kt)\n* [Jetsnack: Custom Design System](https://github.com/android/compose-samples/blob/main/Jetsnack/app/src/main/java/com/example/jetsnack/ui/theme/Theme.kt)\n\n### Animations\n* [Jetsurvey: AnimatedContent](https://github.com/android/compose-samples/pull/842)\n* [Jetcaster: Animated theme colors](https://github.com/android/compose-samples/blob/69e9d862b5ffb321064364d7883e859db6daeccd/Jetcaster/app/src/main/java/com/example/jetcaster/util/DynamicTheming.kt)\n* [Jetsnack: Animating Bottom Barl](https://github.com/android/compose-samples/blob/main/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Home.kt)\n\n### Text\n* [Jetchat: Downloadable Fonts](https://github.com/android/compose-samples/pull/787)\n\n### Large Screens\n* [Jetcaster - Supporting Pane](https://github.com/android/compose-samples/blob/3dbbf0912b57dacefcfb79191a2d7d6b053dadb8/Jetcaster/app/src/main/java/com/example/jetcaster/ui/home/Home.kt#L282)\n* [Jetnews - Window Size Classes](https://github.com/android/compose-samples/blob/69e9d862b5ffb321064364d7883e859db6daeccd/JetNews/app/src/main/java/com/example/jetnews/ui/MainActivity.kt#L36)\n\n### TV\n* [Jetcaster - TV](https://github.com/android/compose-samples/tree/3dbbf0912b57dacefcfb79191a2d7d6b053dadb8/Jetcaster/tv-app)\n\n### Wear\n* [Jetcaster - Wear](https://github.com/android/compose-samples/tree/3dbbf0912b57dacefcfb79191a2d7d6b053dadb8/Jetcaster/wear)\n\n## Formatting\n\nTo automatically format all samples: Run `./scripts/format.sh`\nTo check one sample for errors: Navigate to the sample folder and run `./gradlew --init-script buildscripts/init.gradle.kts spotlessCheck`\nTo format one sample: Navigate to the sample folder and run `./gradlew --init-script buildscripts/init.gradle.kts spotlessApply`\n\n## Updates\n\nTo update dependencies to their new stable versions, run:\n\n```\n./scripts/updateDeps.sh\n```\n\nTo 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. \n\n## Obsolete Sample Projects\n\nOver time some of our samples become a little stale and are removed to keep the\nrepository easy to navigate. If you are curious you can still find them in the \nhistory, however if you are new you might be better served sticking to\nthe most up to date resources.\n\n| Project                                          | Removed    | Commit                                                              |\n| ------------------------------------------------ | -----------|-------------------------------------------------------------------- |\n| [Crane](../../../tree/v2024.05.00/Crane)         | 2024-08-02 | [ee8e272](../../../commit/ee8e27289f4bc36304ee9f04397f49c35f402a65) |\n| [Owl](../../../tree/v2024.05.00/Owl)             | 2024-08-02 | [ee8e272](../../../commit/ee8e27289f4bc36304ee9f04397f49c35f402a65) |\n| [Jetsurvey](../../../tree/v2024.05.00/Jetsurvey) | 2024-08-02 | [ee8e272](../../../commit/ee8e27289f4bc36304ee9f04397f49c35f402a65) |\n| [Rally](../../../tree/v2024.05.00/Rally)         | 2024-08-02 | [ee8e272](../../../commit/ee8e27289f4bc36304ee9f04397f49c35f402a65) |\n\n## License\n```\nCopyright 2024 The Android Open Source Project\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":["Kotlin","Samples","\u003ca name=\"app-projects\"\u003e\u003c/a\u003e App Projects","Sample Projects","Android","Android 应用","android","必备开发库"],"sub_categories":["UI","Android samples","网络服务_其他","UI 开发"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroid%2Fcompose-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandroid%2Fcompose-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroid%2Fcompose-samples/lists"}