Anyone know how to scroll and collapse a portion o...
# compose
k
Anyone know how to scroll and collapse a portion of a Column in Compose?
I've tried using the ScrollState, MotionLayout etc. but nothing has really worked so far
d
What are you trying to accomplish?
k
I want something that behaves like a collapsing toolbar, but not inside of a toolbar. Once I scroll up, I want to hide all but the top row
Then expand it out the other way
d
Is this item in a list? Like a
LazyColumn
?
k
I am using a Column with Scrollable
d
I see.
My first idea would be to animate the height of the item based on it’s position from the top of the Column.
Is the item sticky? As in does it stay visible even after its collapsed? Like a
LazyListScope.stickyHeader
?
Objects will scroll underneath it?
k
The top row is always visible
a
This seems like a use-case for LazyColumn with sticky header
d
Agreed that would get you mostly the way there.
k
Thanks