davideas / FlexibleAdapter

Fast and versatile Adapter for RecyclerView which regroups several features into one library to considerably improve the user experience :-)
Apache License 2.0
3.55k stars 548 forks source link

Sticky header does not appear after returning to list screen #698

Open VitaliBov opened 5 years ago

VitaliBov commented 5 years ago

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:

  1. In the onViewCreated method, the adapter and RecyclerView are initialized
  2. I open the detailed screen
  3. After returning to the list screen, the method onViewCreated called again, but the sticky header does not appear.

Fragment: 1 4

Adapter: 5

Item: 3

Header: 2 7

ezgif com-video-to-gif 2

davideas commented 5 years ago

@VitaliBov, do you rebuild the fragment after returning from details? Or you push a new Activity on top?

What logs say? Adapter.enableLogs(level..)

VitaliBov commented 5 years ago

@davideas, I rebuild the fragment.

At the beginning: image image image image image

After returning to the list: image image image

davideas commented 5 years ago

Thank, I will analyse the logs, but I strongly suggest to open a new Activity, at least it resolves immediately your issue.

VitaliBov commented 5 years ago

@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.