From the course: Android Compose with Kotlin

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Explore lazy layouts in Compose

Explore lazy layouts in Compose - Kotlin Tutorial

From the course: Android Compose with Kotlin

Explore lazy layouts in Compose

- [Instructor] Column and row layouts compose and lay out their items, whether or not they're visible. This can lead to performance issues when you're dealing with large lists, whereas lazy layouts only compose items as needed. Let's explore the use of these lazy components. But first, here's the list item we'll be working with. It's in the SessionItem file, and it contains the SessionItem Composable. This is going to be an ElevatedCard that is made up of a row, which contains a column and an icon. The column consists of various information about a given session, like the tags, the room name, the name of the session, as well as some information about the speaker. This is going to be the item that we use for our lazy layouts. So let's go back and take a look. We'll start with the lazy column. Let's go ahead and add one of our SessionItems. So let's say SessionItem, and we'll set the sessionInfo property equal to our uiState. SessionInfos, and let's just grab the first one. Okay…

Contents