Let’s start simple with a basic list of String items. How to do the old way and what’s Jetpack compose manner.

RecyclerView and adapter

Here you have to bind the recycler view, setup layout manager for triggering onBindViewHolder and getItemCount, create Adapter and finally write xml layouts for recycler view and its inner items.

Jetpack compose

With Compose, simply create a function with @Composable. Use a LazyColumnFor, pass data and create your inner items in LazyItemScope.

That’s all. This example with list may be the most significant where Jetpack compose shines.

You understand that Jetpack compose is not only a cool tool for developpers. It’s also about productivity 🚀, clean, readable and maintanable code.