0
0
Android Kotlinmobile~5 mins

LazyColumn for lists in Android Kotlin - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
APreloads all items at once
BDisplays items horizontally
CAutomatically sorts list items
DOnly composes visible items to improve performance
Which function is used inside LazyColumn to display a list of data?
Aitems()
BlistOf()
CforEach()
Dmap()
How do you add vertical space between items in LazyColumn?
AUse horizontalArrangement
BUse verticalArrangement = Arrangement.spacedBy()
CAdd padding to each item manually
DWrap items in a Spacer composable
What type of state object helps control scroll position in LazyColumn?
AMutableState
BScrollState
CLazyListState
DViewModelState
Which of these is NOT a benefit of using LazyColumn?
AAutomatically sorts list items alphabetically
BImproved performance for large lists
COnly visible items are composed
DAutomatic item recycling
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.