FlexibleAdapter
FlexibleAdapter copied to clipboard
Sticky header does not appear after returning to list screen
Hello. Thank you for the great library.
I had a problem with sticky headers. I need to show a sticky header when displaying the fifth item in the list. Header disappears when you click "OK" or "Cancel". The appearance of the header and its disappearance animated. I decided to initially call the setDisplayHeadersAtStartUp(true)
method. Header container initially invisible.
My procedure is:
- In the onViewCreated method, the adapter and RecyclerView are initialized
- I open the detailed screen
- After returning to the list screen, the method onViewCreated called again, but the sticky header does not appear.
Fragment:
Adapter:
Item:
Header:
@VitaliBov, do you rebuild the fragment after returning from details? Or you push a new Activity on top?
What logs say? Adapter.enableLogs(level..)
@davideas, I rebuild the fragment.
At the beginning:
After returning to the list:
Thank, I will analyse the logs, but I strongly suggest to open a new Activity, at least it resolves immediately your issue.
@davideas Yes, when using Activity, the problem does not occur. We use architecture with Single Activity, and we would like to implement everything in fragments.