Trying to create an ExpandableListView. The initial view with the groups shows up fine. However, when I click the list item, my arrow does not change. See the images below.<
I am a bit late to the party but my requirement was something similar to this but something was different.
I had 3 requirements:
To achieve something similar to this:
Your ExpandableListView will look something similar to this with android:groupIndicator null
Your group/header layout will look something like this with text and image at the end:
In your BaseExpandableListAdapter's getGroupView() method, use
if (Objects.requireNonNull(expandableListDetail.get(expandableListTitle.get(listPosition))).size() > 0) {
if (isExpanded) {
ivIcon.setImageResource(R.drawable.arrow_up);
} else {
ivIcon.setImageResource(R.drawable.arrow_down);
}
}
Where, expandableListTitle is group and expandableListDetail is its children