vinaygaba/Learn-Jetpack-Compose-By-Example

πŸš€ This project contains various examples that show how you would do things the "Jetpack Compose" way

Kotlin

3,454

271 commits

updated Sep 4, 2025

See the code

README

Learn Jetpack Compose By Example

Android CI Compose Version Android Weekly

Feature Image

Over the course of the last few years Android development has gone through significant changes in how we structure our apps, the language we use for development, the tooling & libraries that help us speed up our development and the improvements in testing our apps. What had not changed in all these years is the Android UI toolkit. This changes with Jetpack Compose that aims to re-imagine what Android UI development would look like using declarative programming principles. It is heavily influenced by existing web and mobile frameworks such as React, Litho, Vue & Flutter and would be a paradigm shift in Android UI development as we know it.

This repository aims to show the Jetpack Compose way of building common Android UI that we are accustomed to building.

Supporters

Special thanks to the following companies for supporting my work πŸ™πŸ»

Runway

Chaos-free mobile release management.


Screenshotbot


Emerge Tools


Sofy.ai

Talks

I'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:

360|AnDev 2020: Learning Jetpack Compose By Example Video| Slides

Android Summit 2020: Learn Jetpack Compose By Example v2 Slides

Setup

To try out this sample app, you need to at least use the latest version of Android Studio. This project has been tested against Android Studio Artic Fox. You can download it here. In general, Jetpack Compose requires you to use the Canary version of Android Studio.

Examples

Each example is meant to be self contained and tries to explain all the concepts that its using with comments. Compose also comes with this nifty feature that lets you preview each component in the IntelliJ IDE itself. To do so, go to any of the examples and then click on the preview button in the top right corner. This is possible if your @Composable component has a corresponding @Preview method associated with it. Look at the examples below for all this to make a bit more sense.

Jetpack Compose Preview Functionality

General

State Management

Material Design

Text

Images

Lists

Flexible Layouts

Custom Views

Interoperability

Testing

Credits

Author: Vinay Gaba (vinaygaba@gmail.com)

Follow me on Twitter Follow me on LinkedIn

License

Copyright 2022 Vinay Gaba

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

   http://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.
android
android-ui
compose
declarative-ui
jetpack
jetpack-compose
kotlin
kotlin-android
sample-app
ui-toolkit

vinaygaba/Learn-Jetpack-Compose-By-Example

πŸš€ This project contains various examples that show how you would do things the "Jetpack Compose" way

Kotlin

3,454

271 commits

updated Sep 4, 2025

See the code

README

Learn Jetpack Compose By Example

Android CI Compose Version Android Weekly

Feature Image

Over the course of the last few years Android development has gone through significant changes in how we structure our apps, the language we use for development, the tooling & libraries that help us speed up our development and the improvements in testing our apps. What had not changed in all these years is the Android UI toolkit. This changes with Jetpack Compose that aims to re-imagine what Android UI development would look like using declarative programming principles. It is heavily influenced by existing web and mobile frameworks such as React, Litho, Vue & Flutter and would be a paradigm shift in Android UI development as we know it.

This repository aims to show the Jetpack Compose way of building common Android UI that we are accustomed to building.

Supporters

Special thanks to the following companies for supporting my work πŸ™πŸ»

Runway

Chaos-free mobile release management.


Screenshotbot


Emerge Tools


Sofy.ai

Talks

I'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:

360|AnDev 2020: Learning Jetpack Compose By Example Video| Slides

Android Summit 2020: Learn Jetpack Compose By Example v2 Slides

Setup

To try out this sample app, you need to at least use the latest version of Android Studio. This project has been tested against Android Studio Artic Fox. You can download it here. In general, Jetpack Compose requires you to use the Canary version of Android Studio.

Examples

Each example is meant to be self contained and tries to explain all the concepts that its using with comments. Compose also comes with this nifty feature that lets you preview each component in the IntelliJ IDE itself. To do so, go to any of the examples and then click on the preview button in the top right corner. This is possible if your @Composable component has a corresponding @Preview method associated with it. Look at the examples below for all this to make a bit more sense.

Jetpack Compose Preview Functionality

General

State Management

Material Design

Text

Images

Lists

Flexible Layouts

Custom Views

Interoperability

Testing

Credits

Author: Vinay Gaba (vinaygaba@gmail.com)

Follow me on Twitter Follow me on LinkedIn

License

Copyright 2022 Vinay Gaba

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

   http://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.
android
android-ui
compose
declarative-ui
jetpack
jetpack-compose
kotlin
kotlin-android
sample-app
ui-toolkit

Project health

Overall

3.2/10

Maintained

0/10

Code review

2/10
OpenSSF Scorecard

Significant stargazers

Ryan Brooks

82 followers Β· starred Aug 2020

Bernat BorrΓ‘s Paronella

273 followers Β· starred Feb 2021

ヒハパド

13 followers Β· starred Jun 2020

Rahul Sainani

57 followers Β· starred May 2020