FlexibleAdapter icon indicating copy to clipboard operation
FlexibleAdapter copied to clipboard

Sticky header does not appear after returning to list screen

Open VitaliBov opened this issue 6 years ago • 4 comments

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

VitaliBov avatar Dec 17 '18 08:12 VitaliBov

@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 avatar Dec 17 '18 09:12 davideas

@davideas, I rebuild the fragment.

At the beginning: image image image image image

After returning to the list: image image image

VitaliBov avatar Dec 17 '18 09:12 VitaliBov

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

davideas avatar Dec 17 '18 09:12 davideas

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

VitaliBov avatar Dec 17 '18 09:12 VitaliBov