Building Lists with Jetpack Compose
In the previous chapter, we learned how to fetch data (including lists of items and image URLs) from APIs and how to load images from URLs. Combining that knowledge with the ability to display lists of items allows us to implement rich user interfaces and is the goal of this chapter.
Quite often, you will want to present your users with a list of items. For example, you might want to show them a list of pictures on their device or let them select their country from a list of all countries. To do that, you would need to populate multiple views, all sharing the same layout but presenting different content.
In this chapter, you will learn how to add lists and grids of items to your apps and effectively leverage the recycling power of lazy lists. You’ll also learn how to handle user interaction with the item views on the screen and support different item view types, such as for titles. Later in the chapter, you’ll add and remove...