I tried to look for reasons to use LazyColumn vs Column with verticalScroll. What is the difference between them? Like why would one be an ideal choice compare to other. They both make screen scrollable, isn't it? Would choosing one over the other one be wrong in any case?
LazyColumn is RecyclerView counterpart of Compose while Column with verticalScroll is ScrollView counterpart.
Any Composable inside Column with vertical scroll enters composition the moment Column is composed while LazyColumn uses SubcomposeLayout to subcompose Composables on screen and one extra when you reach last visible item on Screen.
Also LazyColumn offers some features where Column doesn't
flingBehavior: FlingBehavior = ScrollableDefaults.flingBehavior()
let's so you easily implement flingBehavior especially with 1.3.0-beta02 snap behavior can implemented with rememberSnapFlingBehavior()
Also rememberLazyListState() provides information about first item index, offset and layoutInfo and visible items which enables more customization than rememberScrollState() like this color and scale animation using visible item positions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With