Is there a way to create sticky headers in compose...
# compose
z
Is there a way to create sticky headers in compose?
v
It’s coming really soon. Being worked on right now - https://android-review.googlesource.com/c/platform/frameworks/support/+/1427927
👍 5
💪 2
m
Care to explain what you mean by sticky headers?
k
You can use
LazyColumn
's
item
function to define common headers, list separators or footers, if that works for you.
z
@Mehdi Haghgoo this is what I was talking about
❤️ 1
@Kshitij Patil Implementing separators and headres are not the issue, it's the sticky part I am trying to figure out, there were a bunch of libreries that handled that great in recycler views.
k
What if we keep
currentLetter
as a
mutableState
and update it after scrollable crossed certain index, header will be a the same item showing a letter but the letter will get updated accordingly.
z
Interesting, this just might work, I will ping after trying it. Tnx.
k
Sure, let me know how it goes