Is it possible to use Collapsing Toolbar with Lazy...
# compose
a
Is it possible to use Collapsing Toolbar with LazyColumn in Jetpack Compose? Or is this not possible right now? I would like to migrate the RecyclerView to LazyColumn while using Collapsing Toolbar. (how would you add layout_behavior = appbar_scrolling_view_behavior?)
1
n
your CollapsingToolbar is an Android standard View right ? Then I don't think i will ever work
a
yes, I use the same toolbar with many different fragments
z
I don’t think there’s native support for this, however you can observe the scroll position change of your list then adjust the height/position of the toolbar
a
ah thats a good idea, i could then just set the toolbar to expanded = false / true
if its below a certain threshold or scrolled at all
n
it will probably require some adjustement but it can be done that way
s
Check Jetsnack sample app. It has implemented a similar effect.
a
Jetsnack is Compose Only, I want to integrate compose in traditional app
@Zun how would you check if the scroll position is != 0 in compose?
s
Copy code
listState.firstVisibleItemIndex
a
that is the first visible item index, not scroll offset