I am having trouble using an ExpandableListView because the type of childItems in each group varies greatly. In one section there are contacts from the phone box, another has a view with a progressBar in and the last one has a TextView in.
I have thought about using 3 individual ExpandableListViews, each with their own adapter and handlers, but this seems a bit crazy too, particularly when some of the ‘lists’ only have one item in and it never changes. Essentially I am using ExpandableListViews to create expandable sections in my UI, and it doesn’t really feel right.
Is there a better UI element to use?
If they are completely distinct like it sounds like they are, you may want to look into using
Fragments. It’s a lot of new stuff you learn if you’re not familiar with them, but you can then easily reproduce the collapsing mechanic usingAnimationscoupled with hiding theFragments. This also decouples the 3 UI elements (contacts, progress bar, text view) from each other, so you can reuse the Fragments pretty much anywhere you want.