1

I have a complex list based UI that is based around scroll events. It's laid out in the following order

TextView
Tablayout --> Each tab is a textview of a LazyList section header 
LazyList 
    SectionHeader
        Item
        Item 
        Item
   SectionHeader 
BottomButton

The screen needs to support the following interactions

  1. When a user selects a tab in the tablayout the LazyList scrolls to the corresponding StickHeader
  2. When the user scrolls so that a StickyHeader section reaches the top of the screen of the LazyList; so it is the top item of the list; and the divider line at the top of the item becomes visible the tablayout needs to scroll to the corresponding section.

So I need the following capabilities.

  1. For LazyList I need to be able to scroll to an item using the item position
  2. For StickyHeader I need an event for when the StickyHeader reaches the top of the screen; or it replaces the StickyHeader that is currently in 'Sticking' state. I also would need to get the position that it is in the list.

Are these possible? If you know how to do this and have any documentation please let me know!

4
  • What have you tried so far? I think your question is a bit broad. Commented Jun 10, 2024 at 21:41
  • Also please explain if the LazyListState (fromrememberLazyListState()) scroll functions solve your first problem. Commented Jun 10, 2024 at 21:45
  • Hello, sorry for the late reply. I was able to solve the first problem using lazyList fairly easily. The second issue is a framework bug. I know this because it is only reproducible when you have a section with a single item. If all of the sections have more than one item there is no problem. It's not a size issue either; as I played around with the size of that on item; making it larger or smaller than the regular item size and it's the same problem. I have some screencasts and I'm going to create a bug ticket with the Google Android team. Commented Jun 20, 2024 at 22:25
  • Just another update I created a custom solution using an overlay and a canvas and it's working pretty well Commented Jun 25, 2024 at 0:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.