Created
December 7, 2023 07:48
-
-
Save mohanmanu484/7252c042e9c1f391ddd8a740bef78481 to your computer and use it in GitHub Desktop.
Lazy List saver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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