0

I am using daimajia.slider for my app and want to use it as an header for recycler view.

Please help me on how to use this as the header of recycler view or give that similar effect to the user.

Note : Inflating it in a relative layout programatically is causing issues and moreover hiding few of the list items. The main issue with this approach is that when I scroll down the slider doesn't get scrolled only the list does.

Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
Prabhu Konchada
  • 548
  • 8
  • 26
  • 1
    RecyclerView doesn't have a header. And I think you want a sticky header. You may find a 3rd party library out there. – Sufian Nov 27 '15 at 06:24
  • @Sufian I want a sticky header for recycler view and that sticky header consists of a slider https://github.com/daimajia/AndroidImageSlider . Any help is appreciated. Thank you :) – Prabhu Konchada Nov 27 '15 at 06:29
  • 1
    As I said, you may find a 3rd party library for a sticky header. Or you could just go with a View subclass (RelativeLayout, etc) above your RecyclerView. It would have the same effect. – Sufian Nov 27 '15 at 06:34
  • @Sufian As mentioned a Relative layout above the recycler view doesn't move the header with the recycler view when I move down is there a work around for this ?? – Prabhu Konchada Nov 27 '15 at 06:38
  • @Sufian A sticky header that moves when scrolling down the recycler list. Hope you understand if not please ask I will provide you the screenshots of the implementation you have recommended and the problem elaborately. Thank you – Prabhu Konchada Nov 27 '15 at 06:41
  • Sticky header will only stick to the top as long as its section is getting displayed. Check out one of the sticky header libraries to see that or check out Chris Banes' [cheesesquare](https://github.com/chrisbanes/cheesesquare/). The detail screen is of your interest. – Sufian Nov 27 '15 at 07:07
  • 1
    Please provide the screenshot, what actually u want to do? – keshav Nov 27 '15 at 07:08

1 Answers1

0

I have found the solution here very beautifully explained

Is there an addHeaderView equivalent for RecyclerView?

This solved my problem and gave the desired output as mentioned.

Community
  • 1
  • 1
Prabhu Konchada
  • 548
  • 8
  • 26