Danish Ansari
10/27/2021, 5:29 PMLazyColumn
when navigating from screen A to screen B and coming back
Screen A contains 20 items, user scrolled to 15th item, selected 15th item, Screen B opened, came back, list gets reset, scrolled to 1st item
But I want the 15th item to be visibleAndrey Kulikov
10/27/2021, 5:31 PMDanish Ansari
10/27/2021, 5:57 PMLazyColumn
Andrey Kulikov
10/27/2021, 6:04 PMDanish Ansari
10/27/2021, 6:23 PMDanish Ansari
10/27/2021, 6:24 PMDanish Ansari
10/27/2021, 6:24 PMitems
but multple item
as per my needDanish Ansari
10/27/2021, 6:24 PMDanish Ansari
10/27/2021, 6:27 PMTolriq
10/27/2021, 6:31 PMDanish Ansari
10/27/2021, 6:31 PMDanish Ansari
10/27/2021, 6:34 PMTolriq
10/27/2021, 6:34 PMDanish Ansari
10/27/2021, 6:36 PMLazyColumn{
item { PopularMovies() }
item { NowPlayingMoviee() }
...
}
Tolriq
10/27/2021, 6:38 PMval state = rememberLazyListState()
And pass the state to LazyColum(state=state) You can then easily log the state and see what is happneingAndrey Kulikov
10/27/2021, 6:40 PMDanish Ansari
10/27/2021, 7:02 PMrememberLazyListState()
manually alsoTolriq
10/27/2021, 7:06 PMDanish Ansari
10/27/2021, 7:10 PMfirstVisibleItemIndex
is non 0 then it's becoming 0Tolriq
10/27/2021, 7:12 PMDanish Ansari
10/27/2021, 7:14 PMnavController.popBackStack()
could that be the reason?Tolriq
10/27/2021, 7:19 PMDanish Ansari
10/27/2021, 7:24 PMDanish Ansari
10/27/2021, 7:25 PMDanish Ansari
10/27/2021, 7:26 PM