Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sticky header does not call bind methods when it transitions from stuck header to scrollable item #1364

Open
ryannickel-autodesk opened this issue Sep 8, 2023 · 0 comments

Comments

@ryannickel-autodesk
Copy link

ryannickel-autodesk commented Sep 8, 2023

We are using the Kotlin with the View Holder pattern. I added logging statements that are output when preBind, bind and unbind are called on the model to determine the root cause.

  1. In a recycler view add items, some with sticky headers - need to have multiple sticky header items with some other items between them. For this example assume we have Sticky Headers 0, 5, and 10 with 4 items between them.
  2. When the recycler view is first displayed observe that prebind and bind is called for all headers displayed.
  3. Scroll down so that a sticky header item 5 is in the middle of the recycler view.
  4. Scroll up until sticky header item 5 is stuck at the top. Observer that prebind and bind are both called.
  5. Scroll down until sticky header item 5 is not stuck at the top (scrolling in the list). Observe that unbind is called, but prebind and bind are not called again once it is back to scrolling with the list.
  6. At this point the only way to get prebind and bind to be called for the instance scrolling in the list is to scroll down and back up again.

So the issue seems to be when the transition from header stuck at the top, to scrolling in the list the prebind / bind methods are not called. Similarly, when the transition from scrolling in the list to stuck header occurs unbind is not called.

May be related to Issue 1230 and this recent comment on the original PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant