ExpandableListView using RecyclerView?

0

Hello, I sometimes needed to create a recyclerview that had the same principle as expandablelistview for this, I have always used this lib

It solves the problem. But is this a good solution?

    
asked by anonymous 01.07.2016 / 16:19

1 answer

2

Yes, if it solves your problem and is easy to use and implemented, it is a good solution, since we do not have it in RecyclerView today.

In my projects I have, at some point I needed to do this, but I chose to do it manually without using the library, because depending on what you will use, it is relatively easy to do.

For example, I have a project here used for restaurants, where you have a list of products and each product on the list has its price list. To implement this I put only a RecyclerView with a Adapter and within this Adapter on onBindViewHolder I put it to create Adapter of the price list. In my product layout, I have a new RecyclerView for price list so the prices are charged within each product. When the user clicks on a product, I change the price list view that is in it to be visible, working as an expandable list.

All this would be easily implemented using this library, but to avoid too many dependencies, and how simple it is for me, I've decided that way.

    
01.07.2016 / 16:41