May 2022
Intermediate to advanced
688 pages
20h 12m
English
Jetpack Compose’s ideas about state and recomposition are woven throughout the framework. In fact, Coda Pizza was leveraging these two concepts even before you added state of your own.
Think about your LazyColumn. It needs to keep track of its scroll position, which it does automatically. But it also uses the state hoisting pattern to allow its parent to manage the scrollable state. How does it do this? To see for yourself, take a look at its signature:
@Composable
fun LazyColumn(
modifier: Modifier = Modifier,
state: LazyListState = rememberLazyListState(),
...
)
rememberLazyListState does two things: It creates a LazyListState object with an initial position at the beginning of the list, ...
Read now
Unlock full access