Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork374
🚀 This project contains various examples that show how you would do things the "Jetpack Compose" way
License
vinaygaba/Learn-Jetpack-Compose-By-Example
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Over the course of the last few years Android development has gonethrough significant changes in how we structure our apps, the languagewe use for development, the tooling & libraries that help us speed upour development and the improvements in testing our apps. What had notchanged in all these years is the Android UI toolkit. This changes withJetpack Compose that aims to re-imagine what Android UI developmentwould look like using declarative programming principles. It is heavilyinfluenced by existing web and mobile frameworks such as React, Litho,Vue & Flutter and would be a paradigm shift in Android UI development aswe know it.
This repository aims to show the Jetpack Compose way of building commonAndroid UI that we are accustomed to building.
Special thanks to the following companies for supporting my work 🙏🏻
Chaos-free mobile release management.
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 ExampleVideo|Slides
Android Summit 2020: Learn Jetpack Compose By Example v2Slides
To try out this sample app, you need to at least use the latest versionof 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 ofAndroid Studio.
Each example is meant to be self contained and tries to explain all theconcepts that its using with comments. Compose also comes with thisnifty feature that lets you preview each component in the IntelliJ IDEitself. To do so, go to any of the examples and then click onthe preview button in the top right corner. This is possible if your@Composable component has a corresponding@Preview method associatedwith it. Look at the examples below for all this to make a bit moresense.
| Example | Preview |
|---|---|
| How do I align the baseline of two views? What's the layout weight equivalent in Jetpack Compose? Example with equal weights Example with unequal weights How do I auto arrange my views similar to FlexBox? Add space between views Evenly distribute space Add space around the views Tightly packed centering of views | ![]() |
| How do I use constraint layouts? How do I use guidelines with constraint layouts? How do I add barriers when using constraint layouts? How do I add bias when using constraint layouts? | ![]() |
| Example | Preview |
|---|---|
| How do I draw using a canvas? | ![]() |
| Example of a measuring scale component | ![]() |
| How do I make a view zoomable? | ![]() |
| How do I detect touch events in a custom view? |
| Example | Preview |
|---|---|
| How can I use Jetpack Compose components inside existing screens? | ![]() |
| Example | Preview |
|---|---|
| How can I navigate to different screen in Jetpack Compose? | ![]() |
| Example | Preview |
|---|---|
| How do I write a simple UI Test in Jetpack Compose? How do I test "Composables"? |
Author: Vinay Gaba (vinaygaba@gmail.com)


Copyright 2022 Vinay GabaLicensed 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.0Unless required by applicable law or agreed to in writing, softwaredistributed 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 andlimitations under the License.About
🚀 This project contains various examples that show how you would do things the "Jetpack Compose" way
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors13
Uh oh!
There was an error while loading.Please reload this page.









































