UltimateRecyclerView icon indicating copy to clipboard operation
UltimateRecyclerView copied to clipboard

How can I add a single header at the RecyclerView?

Open OneManStudioDotSe opened this issue 9 years ago • 5 comments

I can't seem to find a way to add a simple header at the RecyclerView. If I use the sticky headers functionality, a sticky header is added at every list entry.

What I want is a simple header (with its own layout) at the top of the list that will either scroll with the list or be sticky.

Is there something that I am missing or this functionality is not available at the library?

OneManStudioDotSe avatar Jul 13 '15 22:07 OneManStudioDotSe

@OneManStudioDotSe I think you should use methods like:

ultimateRecyclerView.setParallaxHeader(View view);
ultimateRecyclerView.setNormalHeader(View view);

You can check usage here: https://github.com/cymcsg/UltimateRecyclerView/blob/master/UltimateRecyclerView/app/src/main/java/com/marshalchen/ultimaterecyclerview/demo/MainActivity.java#L92

sergii-frost avatar Jul 15 '15 08:07 sergii-frost

At same time this seems not to work when using MultiViewAdapter unfortunately :( I have checked out whole project and it works perfectly when header is added from MainActivity but does not work when to add same code to MultiViewTypesActivity

sergii-frost avatar Jul 15 '15 08:07 sergii-frost

It works for the simple case that I want it. Thanks :)

OneManStudioDotSe avatar Jul 15 '15 18:07 OneManStudioDotSe

@OneManStudioDotSe Did you have success with the header? I also need to add one at the top and the header should scroll with the list.

UPDATE: But in my header I also have clickable elements...

Rainer-Lang avatar Nov 07 '15 17:11 Rainer-Lang

+1 MultiViewAdapter

PabloDesiderioFlores avatar Mar 31 '17 21:03 PabloDesiderioFlores