Jetpack Compose Cheat Sheet: Part Two

Everything you need to know about each component used in Jetpack Compose composed in a series of useful blogs.

Dharmesh Basapati
Jetpack Composers
Published in
3 min readSep 6, 2022

--

Jetpack Compose Cheat Sheet: Part Two

This is the continuation of the series I have introduced related to Jetpack Compose where I am posting code snippets of most used components in Compose.

If somehow you missed Part 1, you should definitely have a look here.

So without further ado, let’s continue the thread and post some more useful components from the Compose armour 🫰🏻.

#16 — LazyColumn

A LazyColumn represents a list of data displayed in vertical manner and it is similar to RecyclerView with a vertical LinearLayout orientation.

#17— LazyRow

A LazyRow represents a list of data displayed in horizontal manner and it is similar to RecyclerView with a horizontal LinearLayout orientation.

#18 — LazyVerticalGrid

A LazyVerticalGrid represents a grid of data displayed in vertical manner and it is similar to RecyclerView with a vertical GridLayoutManager.

#19 — AlertDialog

An AlertDialog in Compose serves the similar purpose as in other languages of showing a dialog or popup to the user on performing some action on the app components.

#20 — CircularProgressIndicator

A CircularProgressIndicator is a component used to show any kind of progress in circular or circle shaped indicator. It can be determinate and indeterminate.

#21 —LinearProgressIndicator

A LinearProgressIndicator is a component used to show any kind of progress in linear or horizontally placed indicator. It can also be determinate and indeterminate.

#22 — CheckBox

A Checkbox component in Compose provides functionality of choosing multiple items from given list of items for example selection of hobbies.

#23— RadioButton

A RadioButton component in Compose provides functionality of choosing single item from given list of items for example selection of gender.

#24— Slider

A Slider component in Compose provides functionality of choosing some value by sliding through one horizontal slider for example choosing price from low to high.

#25 — Switch

A Switch component in Compose provides functionality of choosing from two possible options for example enable push notifications or not.

#26— SnackBar

A SnackBar component in Compose provides functionality of showing a minimal popup kind of layout for temporary basis to convey some information to the user like showing — Your post is updated !!!

#26 — Divider

A Divider component in Compose provides functionality of showing a horizontal or vertical line in between some components in your screen to convey some partition or difference.

#27— DropDownMenu

A DropDownMenu component in Compose provides functionality of choosing single item from list of related items like choosing profession from dropdown menu.

Hope you liked this part as well and got some useful snippets to take use of in your next Compose Project. I will be continuing this series with some more useful components as and when they will be introduced and come in existence.

Till then keep sharing the things you have learnt somewhere as it will definitely benefit others as well as your own knowledge.

Note: Part Three with some more nuisances of Compose is Coming Soon !!!

Fresh Update: Part 3 and 4 are now live —

And don’t forget to clap and appreciate the blog if it helps you in any sense. You don’t know but your claps matters, a lot !!!

And if you are an avid reader and crave quality content from all over the world, then you should start your journey from here itself by joining Medium through my referral link.

Kudos !!!

--

--