Implementing Expandable Recycler View in Android Application

Updated 14 December 2016


Expandable Recycler view is alternative of ExpandableListView. There are many times when ExapandableListView don’t perform as per the requirement. It fails in the coordinator layout as well as have layout height issue.

Thus we are creating a simple Expandable Recycle view using bignerdranch’s expandablerecyclerview library.

Dependency used in this blog:

┬ácompile ‘’

1. Custom Parent and Child Classed used to represent the relationship

SubcategoryParentListItem is our parent class that is used to store the data relevant to parent.

SubcategoryChildListItem is our simple child class used to display the content in each child of parent



2. Preparing data for Expandable Recycler View

Creating List of parent item to be displayed in a view.


Creating a list of child item and setting this list to a particular parent.

subcategoryParentListItem.setChildItemList(childItemList); // set the list of child item for a parent item.

3. Setting adapter to a Recycler View to make it EXPANDABLE

4. Implementing Custom adapter to support expansion of views.

Unlike traditional Recycler view in which we have a single view holder and thus single onCreateViewHolder and onBindViewHolder,
We have two different sets of onCreateViewHolder and onBindViewHolder.



That’s all folks. Stay updated !




. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


  • smwaura
  • Shudy
    • Shubham Agarwal
  • InstanttPS Xceleratics
  • Shubham Agarwal
    • Gaurav meghanathi
      • Shubham Agarwal
  • sagar
    • Shubham Agarwal
  • 4face
  • Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home