https://kotlinlang.org logo
Title
n

nuhkoca

04/26/2022, 10:04 PM
Hello, I am trying to make a custom sticky header as I can’t utilize `LazyColumn`’s because status bar is transparent and there is no `TopBar`(only mimic) in my case so I can’t get the desired
offset
and
index
at the right time in no way. Can you tell me how can I show my sticky header once the respective item almost goes out of view? Screen recording in the thread
For ex, sticky header is the
5th
item but it goes out of view when
firstVisibleItemIndex
is
2
, worse if I expand description component, it then goes out of view when
firstVisibleItemIndex
is
4
so index is not working reliably in my case
Current index is not synchronized with scroll state. For example; index of the Sort By view is
4
but
lazyListState
returns
4
too late for example when I am on the
There are currently no items in the list
text. Is that correct or is it an issue? , I didn't understand
Can somebody please help me here if possible, thanks 🙂
m

myanmarking

04/27/2022, 8:08 PM
What do you mean by current index
n

nuhkoca

04/28/2022, 7:43 PM
I meant
firstVisiblemItemIndex
but I got it to working, thanks anyway!
m

myanmarking

04/28/2022, 7:57 PM
You can use the layout info too
n

nuhkoca

04/28/2022, 10:08 PM
yes exactly, I did use layout info + key combination