Recall & Review
beginner
What is a LazyColumn in Jetpack Compose?
LazyColumn is a vertically scrolling list that only composes and lays out the visible items, improving performance for long lists.
Click to reveal answer
beginner
How do you provide a list of data to a LazyColumn?
You use the
items function inside LazyColumn to pass a list and define how each item should be displayed.Click to reveal answer
intermediate
What is the benefit of using
items inside LazyColumn instead of a simple Column?Using
items inside LazyColumn loads only visible items, saving memory and CPU, unlike Column which renders all children at once.Click to reveal answer
beginner
Write a simple Kotlin snippet to display a list of strings in a LazyColumn.
LazyColumn {
items(listOf("Apple", "Banana", "Cherry")) { item ->
Text(text = item)
}
}
Click to reveal answer
intermediate
Can you customize each item in LazyColumn? How?
Yes, inside the
items block you can define any composable UI for each item, like Text, Image, Row, or custom layouts.Click to reveal answer
What does LazyColumn do differently compared to a regular Column?
✗ Incorrect
LazyColumn composes only the visible items on screen, which saves resources compared to Column that composes all children at once.
Which function is used inside LazyColumn to display a list of data?
✗ Incorrect
The items function inside LazyColumn takes a list and defines how each item is displayed.
What type of parameter does the items function take?
✗ Incorrect
The items function takes a list of data items to display each one in the LazyColumn.
How do you access the current item inside the items block?
✗ Incorrect
You access each item by defining a lambda parameter inside items, like { item -> ... }.
Which of these is NOT a benefit of LazyColumn?
✗ Incorrect
LazyColumn does not preload all items; it loads only visible items to save resources.
Explain how LazyColumn improves performance when displaying long lists.
Think about how scrolling a long list feels smooth.
You got /3 concepts.
Describe how to use the items function inside LazyColumn with a list of strings.
Imagine showing a list of fruits on screen.
You got /3 concepts.