{"id":15033236,"url":"https://github.com/vinaygaba/learn-jetpack-compose-by-example","last_synced_at":"2025-05-14T19:09:14.886Z","repository":{"id":40334364,"uuid":"225287739","full_name":"vinaygaba/Learn-Jetpack-Compose-By-Example","owner":"vinaygaba","description":"🚀 This project contains various examples that show how you would do things the \"Jetpack Compose\" way","archived":false,"fork":false,"pushed_at":"2025-05-02T20:22:03.000Z","size":93190,"stargazers_count":3351,"open_issues_count":17,"forks_count":371,"subscribers_count":63,"default_branch":"master","last_synced_at":"2025-05-02T21:27:20.115Z","etag":null,"topics":["android","android-ui","compose","declarative-ui","jetpack","jetpack-compose","kotlin","kotlin-android","sample-app","ui-toolkit"],"latest_commit_sha":null,"homepage":"https://jetpackcompose.app/","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/vinaygaba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["vinaygaba"]}},"created_at":"2019-12-02T04:49:10.000Z","updated_at":"2025-05-02T20:22:08.000Z","dependencies_parsed_at":"2025-05-02T21:22:35.452Z","dependency_job_id":"ab6b4ef9-a012-4cf7-b051-7c0305a43a86","html_url":"https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinaygaba%2FLearn-Jetpack-Compose-By-Example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinaygaba%2FLearn-Jetpack-Compose-By-Example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinaygaba%2FLearn-Jetpack-Compose-By-Example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinaygaba%2FLearn-Jetpack-Compose-By-Example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vinaygaba","download_url":"https://codeload.github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254209859,"owners_count":22032897,"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","android-ui","compose","declarative-ui","jetpack","jetpack-compose","kotlin","kotlin-android","sample-app","ui-toolkit"],"created_at":"2024-09-24T20:20:28.197Z","updated_at":"2025-05-14T19:09:07.545Z","avatar_url":"https://github.com/vinaygaba.png","language":"Kotlin","funding_links":["https://github.com/sponsors/vinaygaba"],"categories":[],"sub_categories":[],"readme":"# Learn Jetpack Compose By Example \n![Android CI](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/workflows/Android%20CI/badge.svg) ![Compose Version](https://img.shields.io/badge/Compose-1.0.1-brightgreen) ![Android Weekly](https://androidweekly.net/issues/issue-414/badge)\n\n![Feature Image](screenshots/jetpack_compose_poster.png)\n\nOver the course of the last few years Android development has gone\nthrough significant changes in how we structure our apps, the language\nwe use for development, the tooling \u0026 libraries that help us speed up\nour development and the improvements in testing our apps. What had not\nchanged in all these years is the Android UI toolkit. This changes with\nJetpack Compose that aims to re-imagine what Android UI development\nwould look like using declarative programming principles. It is heavily\ninfluenced by existing web and mobile frameworks such as React, Litho,\nVue \u0026 Flutter and would be a paradigm shift in Android UI development as\nwe know it.\n\nThis repository aims to show the Jetpack Compose way of building common\nAndroid UI that we are accustomed to building.\n\nSupporters\n-----\n\nSpecial thanks to the following companies for supporting my work 🙏🏻\n\n\n\n\u003cp align = \"center\"\u003e\n  \u003ca href=\"https://www.emergetools.com/?utm_source=jetpack\u0026utm_medium=sponsor\u0026utm_campaign=emerge\" target=\"__blank\"\u003e\n    \u003cb\u003eEmerge Tools\u003c/b\u003e\n  \u003c/a\u003e \u003cbr/\u003e\u003cbr/\u003e\n  \u003ca href=\"https://www.emergetools.com/?utm_source=jetpack\u0026utm_medium=sponsor\u0026utm_campaign=emerge\" target=\"__blank\"\u003e\n    \u003cimg src=\"screenshots/emerge_supporter_banner.png\" width=400 /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n\u003cp align = \"center\"\u003e\n  \u003ca href=\"https://auth.sofy.ai/sofyprod.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1A_SOFY_SIGNUP\u0026client_id=0f3b4e4f-0e94-4658-b5af-7e0c78f0dda2\u0026nonce=defaultNonce\u0026redirect_uri=https%3A%2F%2Fportal.sofy.ai%2Fauth\u0026scope=openid\u0026response_type=id_token\u0026prompt=login\u0026utm_source=jetpackcompose\u0026utm_medium=cpc\u0026utm_campaign=JPC-campaign\" target=\"__blank\"\u003e\n    \u003cb\u003eSofy.ai\u003c/b\u003e\n  \u003c/a\u003e \u003cbr/\u003e\u003cbr/\u003e\n  \u003ca href=\"https://auth.sofy.ai/sofyprod.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1A_SOFY_SIGNUP\u0026client_id=0f3b4e4f-0e94-4658-b5af-7e0c78f0dda2\u0026nonce=defaultNonce\u0026redirect_uri=https%3A%2F%2Fportal.sofy.ai%2Fauth\u0026scope=openid\u0026response_type=id_token\u0026prompt=login\u0026utm_source=jetpackcompose\u0026utm_medium=cpc\u0026utm_campaign=JPC-campaign\" target=\"__blank\"\u003e\n    \u003cimg src=\"screenshots/Sofy_ai.png\" width=400 /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\nTalks\n-----\nI've also used the examples listed in this repo and given talks at conferences. If video is your preferred medium of learning, you can head to the links below:\n\n**360|AnDev 2020: Learning Jetpack Compose By Example**\n[Video](https://www.youtube.com/watch?v=2rEOpqDKOUA)| [Slides](https://speakerdeck.com/vinaygaba/360-andev-2020-learning-jetpack-compose-by-example)\n\n**Android Summit 2020: Learn Jetpack Compose By Example v2**\n[Slides](https://speakerdeck.com/vinaygaba/android-summit-2020-learn-jetpack-compose-by-example)\n\nSetup\n-----\nTo try out this sample app, you need to at least use the latest version\nof Android Studio. This project has been tested against Android Studio Artic Fox.\n[You can download it here](https://developer.android.com/studio/preview).\nIn general, Jetpack Compose requires you to use the Canary version of\nAndroid Studio.\n\nExamples\n-----------------\n\nEach example is meant to be self contained and tries to explain all the\nconcepts that its using with comments. Compose also comes with this\nnifty feature that lets you preview each component in the IntelliJ IDE\nitself. To do so, go to any of the examples and then click on\nthe preview button in the top right corner. This is possible if your\n`@Composable` component has a corresponding `@Preview` method associated\nwith it. Look at the examples below for all this to make a bit more\nsense.\n\n![Jetpack Compose Preview Functionality](screenshots/compose_preview.gif)\n\n### General\n\n|Example|Preview|\n|-------|-------|\n|[How do I display text on the screen using Jetpack Compose?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/text/SimpleTextActivity.kt)|\u003cimg src =\"screenshots/simple_text.png\" width=214 height=400\u003e |\n|[How do I make a view clickable and do actions when clicked?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/AlertDialogActivity.kt#L51)| \u003cimg src =\"screenshots/alert_dialog.gif\" width=214 height=400\u003e |\n|[How do I add padding around a view?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/LayoutModifierActivity.kt#L51) \u003cbr/\u003e  [How do I add an offset to a layout?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/LayoutModifierActivity.kt#L90) \u003cbr/\u003e [How do I enforce a layout to have a fixed aspect ratio?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/LayoutModifierActivity.kt#L112)|\u003cimg src =\"screenshots/layout_modifiers.png\" width=214 height=400\u003e|\n|How do I add a background color to any section of the screen? \u003cbr/\u003e [Example 1](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/text/CustomTextActivity.kt#L187) \u003cbr/\u003e [Example 2](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/DrawerAppActivity.kt#L123)|\u003cimg src =\"screenshots/background_surface1.png\" width=214\u003e \u003cbr/\u003e \u003cimg src =\"screenshots/background_surface2.png\" width=214\u003e |\n|[How do I get FrameLayout like functionality to stack views on top of one another?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/stack/StackActivity.kt)| |\n|How do I do animation in Jetpack Compose? \u003cbr/\u003e[Example: Rotation Animation](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/animation/Animation1Activity.kt) \u003cbr/\u003e [Example: Color Change Animation](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/animation/Animation2Activity.kt) |\u003cimg src =\"screenshots/animation_rotation.gif\" width=214 height=400\u003e \u003cbr/\u003e \u003cbr/\u003e \u003cimg src =\"screenshots/color_animation.gif\" width=214 height=400\u003e|\n|[How do styles \u0026 themes work in Jetpack Compose?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/theme/DarkModeActivity.kt) \u003cbr/\u003e [How do I add dark mode capability to my app?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/theme/DarkModeActivity.kt)|\u003cimg src =\"screenshots/dark_mode.gif\" width=214 height=400\u003e |\n\n\n### State Management\n|Example|Preview|\n|-------|-------|\n|[How do I store state information in Jetpack Compose?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/state/StateActivity.kt)|\u003cimg src =\"screenshots/state_example.gif\" width=214 height=400\u003e |\n|[How do I retain state across process death \u0026 activity recreation(like orientation changes)?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/state/ProcessDeathActivity.kt) | \u003cimg src =\"screenshots/process_death.gif\" width=214 height=400\u003e |\n|[How do I use LiveData/ViewModels with Jetpack Compose?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/state/livedata/LiveDataActivity.kt) | \u003cimg src =\"screenshots/live_data.gif\" width=214 height=400\u003e |\n|[How do I use Coroutine Flow to update my components/views with Jetpack Compose?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/state/coroutine/CoroutineFlowActivity.kt)|\u003cimg src =\"screenshots/coroutine_flow.gif\" width=214 height=400\u003e |\n|[How do you launch a Coroutine inside a Composable? \u003cbr/\u003e How do you do side-effects in Jetpack Compose?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/state/livedata/LiveDataActivity.kt#L170) |\u003cimg src =\"screenshots/live_data.gif\" width=214 height=400\u003e |\n|[How do you handle back press in Jetpack Compose?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/state/backpress/BackPressActivity.kt) | \u003cimg src =\"screenshots/back_press.gif\" width=214 height=400\u003e|\n\n\n### Material Design\n\n|Example|Preview|\n|-------|-------|\n|[How do I add a Material Design Card?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/MaterialActivity.kt#L114) \u003cbr\u003e [How do I display a linear progress bar?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/MaterialActivity.kt#L272) \u003cbr\u003e [What about a circular progress bar?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/MaterialActivity.kt#L325) \u003cbr\u003e [How do I add a Snackbar?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/MaterialActivity.kt#L367) \u003cbr\u003e [How to add a Material Design Slider?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/MaterialActivity.kt#L393) \u003cbr\u003e [How to configure a two/three state checkbox?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/MaterialActivity.kt#L196) \u003cbr\u003e [How do I add a radio button group?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/MaterialActivity.kt#L239)|\u003cimg src =\"screenshots/material_design_components.gif\" width=214 height=400\u003e |\n|[How do I add a Floating Action Button to my screen?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/FixedActionButtonActivity.kt) |\u003cimg src =\"screenshots/fab_bottom_nav.gif\" width=214 height=400\u003e |\n|[How do I create a Bottom App Bar?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/BottomNavigationActivity.kt)|\u003cimg src =\"screenshots/bottom_navigation_components.gif\" width=214 height=400\u003e |\n|[How do I add a drawer to my screen?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/DrawerAppActivity.kt)|\u003cimg src =\"screenshots/drawer_layout.gif\" width=214 height=400\u003e|\n|[How do I add Ripple effect to a view?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/MaterialActivity.kt#L495) | \u003cimg src =\"screenshots/ripple.gif\" width=214\u003e |\n|[How do I add a Button to my screen?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/ButtonActivity.kt)|\u003cimg src =\"screenshots/buttons.png\" width=214 height=400\u003e|\n|[How do I display an alert dialog/popup modal?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/AlertDialogActivity.kt)|\u003cimg src =\"screenshots/alert_dialog.gif\" width=214 height=400\u003e|\n|[How do I make Material Filter Chips that overflow to multiple rows?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/FlowRowActivity.kt) |\u003cimg src =\"screenshots/filter_chips.gif\" width=214 height=400\u003e|\n|[How do I add a shadow around my view?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/material/ShadowActivity.kt) | \u003cimg src =\"screenshots/shadow.png\" width=214 height=400\u003e|\n\n### Text\n\n|Example|Preview|\n|-------|-------|\n|[How do I style \u0026 customize my text?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/text/CustomTextActivity.kt)| \u003cimg src =\"screenshots/text_styles.gif\" width=214 height=400\u003e |\n|[How do you take text input from a user in Jetpack Compose?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/text/TextFieldActivity.kt#L78) \u003cbr/\u003e [How can I use a custom text style for a text input?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/text/TextFieldActivity.kt#L112) \u003cbr/\u003e [How can I change the keyboard type to accept numbers?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/text/TextFieldActivity.kt#L156) \u003cbr/\u003e [How can I create a Search bar?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/text/TextFieldActivity.kt#L193) \u003cbr/\u003e [How can I apply a visual transformation to an input text?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/text/TextFieldActivity.kt#L246) \u003cbr/\u003e [How can I provide a hint for the text input field?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/text/TextFieldActivity.kt#L293)\u003cbr/\u003e [Is there filled text field as per Material Design specification?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/text/TextFieldActivity.kt#L293)|\u003cimg src =\"screenshots/text_input.gif\" width=214 height=400\u003e |\n|[How do I animate parts of my text? \u003cbr/\u003e How do I describe parts of my text to be replaced by alternate views?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/animation/TextAnimationActivity.kt)|\u003cimg src =\"screenshots/text_animation.gif\" width=214 height=400\u003e|\n\n### Images\n\n|Example|Preview|\n|-------|-------|\n|[How do I display an image in Jetpack Compose?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/image/ImageActivity.kt) \u003cbr/\u003e [How to load an image from the resource folder?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/image/ImageActivity.kt#L87) \u003cbr/\u003e [How to make an image view with rounded corners?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/image/ImageActivity.kt#L130) \u003cbr/\u003e [How to load an image over the network using Picasso?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/image/ImageActivity.kt#L161) \u003cbr/\u003e [How to load an image over the network using Glide?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/image/ImageActivity.kt#L223)|\u003cimg src =\"screenshots/load_images.gif\" width=214 height=400\u003e|\n\n### Lists\n\n|Example|Preview|\n|-------|-------|\n|[How do I display a list in my app?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/scrollers/VerticalScrollableActivity.kt)\u003cbr/\u003e [Is there a RecyclerView equivalent?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/scrollers/VerticalScrollableActivity.kt#L48)|\u003cimg src =\"screenshots/vertical_list.gif\" width=214 height=400\u003e|\n|[How can I have a grid layout?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/scrollers/GridLayoutActivity.kt)|\u003cimg src =\"screenshots/grid_layout.gif\" width=214 height=400\u003e |\n|[How can I build a horizontally scrollable carousel?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/scrollers/HorizontalScrollableActivity.kt)| \u003cimg src =\"screenshots/horizontal_list.gif\" width=214 height=400\u003e|\n|[How can I add animations for insertion/deletion of a list item?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/animation/ListAnimationActivity.kt)| \u003cimg src =\"screenshots/list_animation.gif\" width=214 height=400\u003e|\n\n\n### Flexible Layouts\n|Example|Preview|\n|-------|-------|\n|[How do I align the baseline of two views?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/ViewLayoutConfigurationsActivity.kt#L286) \u003cbr/\u003e\u003cbr/\u003e **What's the layout weight equivalent in Jetpack Compose?**\u003cbr\u003e[Example with equal weights](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/ViewLayoutConfigurationsActivity.kt#L78) \u003cbr\u003e[Example with unequal weights](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/ViewLayoutConfigurationsActivity.kt#L110)\u003cbr/\u003e\u003cbr/\u003e **How do I auto arrange my views similar to FlexBox?**\u003cbr\u003e[Add space between views](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/ViewLayoutConfigurationsActivity.kt#L143)\u003cbr\u003e[Evenly distribute space](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/ViewLayoutConfigurationsActivity.kt#L172)\u003cbr\u003e[Add space around the views](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/ViewLayoutConfigurationsActivity.kt#L201)\u003cbr\u003e[Tightly packed centering of views](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/ViewLayoutConfigurationsActivity.kt#L230)|\u003cimg src =\"screenshots/view_layout_arrangements.gif\" width=214 height=400\u003e |\n|[How do I use constraint layouts?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/ConstraintLayoutActivity.kt) \u003cbr/\u003e [How do I use guidelines with constraint layouts?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/ConstraintLayoutActivity.kt#L159) \u003cbr/\u003e [How do I add barriers when using constraint layouts?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/ConstraintLayoutActivity.kt#L230) \u003cbr/\u003e [How do I add bias when using constraint layouts?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/layout/ConstraintLayoutActivity.kt#L315)|\u003cimg src =\"screenshots/constraints.png\" width=214 height=400\u003e|\n\n### Custom Views\n\n|Example|Preview|\n|-------|-------|\n|[How do I draw using a canvas?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/customview/CustomViewActivity.kt)|\u003cimg src =\"screenshots/custom_view.png\" width=214 height=400\u003e|\n|[Example of a measuring scale component](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/customview/MeasuringScaleActivity.kt) | \u003cimg src =\"screenshots/measuring_scale.gif\" width=214 height=400\u003e|\n|[How do I make a view zoomable?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/customview/ZoomableActivity.kt) | \u003cimg src =\"screenshots/zoomable.gif\" width=214 height=400\u003e|\n|[How do I detect touch events in a custom view?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/customview/CustomViewPaintActivity.kt)| |\n\n### Interoperability\n|Example|Preview|\n|-------|-------|\n|[How can I use Jetpack Compose components inside existing screens?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/interop/ComposeInClassicAndroidActivity.kt) | \u003cimg src =\"screenshots/interop.png\" width=214 height=400\u003e|\n\n### Navigation\n|Example|Preview|\n|-------|-------|\n|[How can I navigate to different screen in Jetpack Compose?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/navigation/ComposeNavigationActivity.kt) | \u003cimg src =\"screenshots/compose_navigation_example.gif\" width=214 height=400\u003e|\n\n### Testing\n|Example|Preview|\n|-------|-------|\n|[How do I write a simple UI Test in Jetpack Compose? \u003cbr/\u003e How do I test \"Composables\"?](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/androidTest/java/com/example/jetpackcompose/text/SimpleTextComposableTest.kt) | |\n\nCredits\n-----------------\nAuthor: Vinay Gaba (vinaygaba@gmail.com)\n\n\u003ca href=\"https://twitter.com/vinaygaba\"\u003e\n  \u003cimg alt=\"Follow me on Twitter\"\n       src=\"https://github.com/gabrielemariotti/cardslib/raw/master/demo/images/twitter64.png\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://www.linkedin.com/in/vinaygaba\"\u003e\n  \u003cimg alt=\"Follow me on LinkedIn\"\n       src=\"https://github.com/gabrielemariotti/cardslib/raw/master/demo/images/linkedin.png\" /\u003e\n\u003c/a\u003e\n\n\nLicense\n-----------------\n\n    Copyright 2022 Vinay Gaba\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinaygaba%2Flearn-jetpack-compose-by-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinaygaba%2Flearn-jetpack-compose-by-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinaygaba%2Flearn-jetpack-compose-by-example/lists"}