I\'m looking for an equivalent to addHeaderView for a recycler view. Basically I want to have an image with 2 buttons be added as a header to the listview. Is there a differ
If you want the header to be easily reused across multiple lists, take a look at the version 1.2.0 of recyclerview
library. It introduces ConcatAdapter class which concatenates multiple adapters into a single one. So you can create a header adapter and easily combine it with any other adapter, like:
myRecyclerView.adapter = ConcatAdapter(headerAdapter, listAdapter)
The announcement article contains a sample how to display a loading progress in header and footer using ConcatAdapter
.
For the moment when I post this answer the version 1.2.0
of the library is in alpha stage, so the api might change. You can check the status here.