Chachako
05/04/2021, 3:11 PMa/b/c, when go to c, I should save the location of a and bZach Klippenstein (he/him) [MOD]
05/04/2021, 3:57 PMChachako
05/04/2021, 4:41 PMLazyColumn, probably a fake navigation implementationZach Klippenstein (he/him) [MOD]
05/04/2021, 4:47 PMZach Klippenstein (he/him) [MOD]
05/04/2021, 4:48 PMSaveableStateRegistry machinery to save and restore scroll position. This requires support from your navigation infra. Jetpack Nav will support this, as should other real navigation libraries (compose-backstack, compose-router i think, etc), but if you’re building one yourself it’s going to take a little extra work.Ian Lake
05/04/2021, 4:55 PMLazyColumn, then you'll need to hoist and save the LazyListState for each of your lists (i.e., one for a, one for b, etc.), just passing down the right state with the right contents of the list as you swap between themChachako
05/04/2021, 5:05 PMChachako
05/04/2021, 5:08 PMLazyListState for each lists cause performance problems? Maybe just save its initialFirstVisibleItemIndex and initialFirstVisibleItemScrollOffset for each lists?Ian Lake
05/04/2021, 6:12 PMLazyListState itself is very small; you'd want to hoist the whole objectChachako
05/04/2021, 6:29 PM