https://kotlinlang.org logo
#compose
Title
# compose
d

Daniele B

09/03/2020, 11:58 AM
I am developing a master/detail app, with a
LazyColumnFor
showing a list of items on the master screen. When click on an item to access the detail screen, and then I come back to the master screen, the position of the list is not kept. It is always reset to the top. Is there a way to keep the position of the
LazyColumnFor
?
a

Adam Powell

09/03/2020, 1:29 PM
@Andrey Kulikov may be able to give more details on how to work with state save/restore when navigating around like that
t

Timo Drick

09/03/2020, 1:34 PM
As far as i know this is not supported yet. At least not in alpha02. I do not see any savedInstanceState position saving in code.
Maybe in the next release?
a

Andrey Kulikov

09/03/2020, 1:49 PM
yes, it is not supported yet. but soon we will 1) save/restore LazyColumFoR scroll position 2) have a navigation library integration with saving and restoring the state for the backstack
👀 1
👍 9
d

Daniele B

09/03/2020, 2:31 PM
@Andrey Kulikov thanks! any idea for how long. It’s more about 1 week or more about 1 month or more?
a

Andrey Kulikov

09/03/2020, 2:34 PM
hard to say exactly, but more of a month
t

Timo Drick

09/03/2020, 2:35 PM
@Daniele B i did implemented a custom solution which i am using until official API is ready for use. It is a small navigation framework including transition animation support and since yesterday also Save/Restore SavedInstanceState data. And also a Custom LazyColumnFor implementation that supports saving scroll position (LayoutList). If you want you can have a look. https://gitlab.com/timod/compose-playground
👍 1
Unfortunately there is no documentation 😄 but just ask me if you want to use it and have questions.