Skip to content

Instantly share code, notes, and snippets.

@mohanmanu484
Created December 7, 2023 07:48
Show Gist options
  • Select an option

  • Save mohanmanu484/7252c042e9c1f391ddd8a740bef78481 to your computer and use it in GitHub Desktop.

Select an option

Save mohanmanu484/7252c042e9c1f391ddd8a740bef78481 to your computer and use it in GitHub Desktop.
Lazy List saver
val Saver: Saver<LazyListState, *> = listSaver(
save = { listOf(it.firstVisibleItemIndex, it.firstVisibleItemScrollOffset) },
restore = {
LazyListState(
firstVisibleItemIndex = it[0],
firstVisibleItemScrollOffset = it[1]
)
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment