This project explore the different ways to create an expandable listview and how they are implemented.
In this project, I use the ExpandableListView provided by Android API and also ExpandableRecyclerViewcreated by bignerdranch.
I use a SlidingTabLayout to display each expandable list inside its own Fragment. To see how to implement a SlidingTabLayout, you can take a look at my SlidingTabLayout sample.
Here's what the project looks like:

this is a tutorial for ExpandableListView.
- create a layout xml that contains ExpandableListView.
- create a xml for the list group item for ExpandableListView.
- create a xml for the list child item for each individual group of ExpandableListView.
- create a list for parent group.
- create a list for each child group.
- create a new HashMap to associate each child list with its corresponding parent item.
In order to build your own Custom Expandable List Adapter, create your own adapter and extends BaseExpandableListAdapter.
- pass data to adapter through constructor.
- inflate the view for parent in getGroupView.
- inflate the view for child in getChildView.
- implement all the method from BaseExpandableListAdapter.
- get the ExpandavleListView instance from xml.
- load/init data for ExpandableListView.
- init CustomExpandableListAdapter with data.
- set the adapter for ExpandavleListView.
- set clickListener and collapse/expand Listener for ExpandavleListView.
ExpandableRecyclerView is a library written to allow for an expanded view to be attached to each ViewHolder. To allow for full functionality of a normal RecyclerView, the RecyclerView has been modified to use two types of ViewHolders, a child and a parent with the ability to customize each separately.
- add dependencies to app's build.gradle file
- create xml for parent/child list item layout
- create ViewHolder for parent/child class which extends ParentViewHolder/ChildViewHolder
- create ParentObject which implements the ParentListItem
- create CustomExpandableRecyclerAdapter by extending ExpandableRecyclerAdapter<MyParentViewHolder, MyChildViewHolder>
- get instance for RecyclerView and set the layoutManager and adapter.