How to add ExpandableListadApter to MergeAdapter from cwac

I am using MergeAdapter from: https://github.com/commonsguy/cwac-merge

I want to add an ExpandableListadApter to the MergeAdapter, but it currently takes the type of "ListAdapter". Does anyone know a way to do this?

+4
source share
1 answer

AFAIK, MergeAdapter only supports the ListAdapter interface. Besides deploying the repo and adding ExpandableListAdapter support, there really is only one other way, I think you could β€œhack” a quick solution.

Android uses the ExpandableListConnector to map the ExpandableListAdapter to the BaseAdapter . You can literally copy this class into your project and create it using the ExpandableListAdapter . This will give you a ListAdapter compatible adapter that you can use with the MergeAdapter .

Notice, I never tried this ... but theoretically it should work.

ExpandableListConnector source code

0
source

Source: https://habr.com/ru/post/1479018/


All Articles