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 add items to a LazyColumn?
You use the
items() function inside LazyColumn to provide a list of data and a composable for each item.Click to reveal answer
intermediate
Why is LazyColumn preferred over Column for long lists?
Because LazyColumn only creates the visible items, it uses less memory and CPU, making scrolling smooth even with many items.
Click to reveal answer
intermediate
What parameter helps LazyColumn remember scroll position?
The
state parameter with a LazyListState object helps remember and control scroll position.Click to reveal answer
beginner
How can you add spacing between items in a LazyColumn?
You can add spacing by using the
verticalArrangement = Arrangement.spacedBy(8.dp) parameter inside LazyColumn.Click to reveal answer
What does LazyColumn do differently than a regular Column?
✗ Incorrect
LazyColumn only composes and lays out the items currently visible on screen, unlike Column which composes all children.
Which function is used inside LazyColumn to display a list of data?
✗ Incorrect
The items() function takes a list and a composable lambda to display each item in LazyColumn.
How do you add vertical space between items in LazyColumn?
✗ Incorrect
verticalArrangement = Arrangement.spacedBy() adds consistent vertical spacing between items.
What type of state object helps control scroll position in LazyColumn?
✗ Incorrect
LazyListState is designed to track and control the scroll position of LazyColumn.
Which of these is NOT a benefit of using LazyColumn?
✗ Incorrect
LazyColumn does not sort items; sorting must be done before passing data.
Explain how LazyColumn improves performance when displaying long lists.
Think about what happens when you scroll a long list on your phone.
You got /3 concepts.
Describe how to add a list of strings to a LazyColumn with spacing between items.
Remember the parameters inside LazyColumn and how you display each item.
You got /3 concepts.