ExpandableLayout
ExpandableLayout copied to clipboard
when expanding or Collapsing, never calling renderParent
when expanding or Collapsing, never calling renderParent
I have the same issue.....can't change the collapse image
Swap the arrow in the setRenderer to this:
view.findViewById(R.id.arrow).setBackgroundResource(isExpanded ? R.drawable.arrow_down : R.drawable.arrow_up);
Then you can can this two functions already available in the library with this:
sectionLinearLayout.setExpandListener((ExpandCollapseListener.ExpandListener<FruitCategory>) (parentIndex, parent, view) -> { /* change arrow when expanded */ view.findViewById(R.id.arrow).setBackgroundResource( R.drawable.arrow_down); });
sectionLinearLayout.setCollapseListener((ExpandCollapseListener.CollapseListener<FruitCategory>) (parentIndex, parent, view) -> { /* change arrow when collapsed */ view.findViewById(R.id.arrow).setBackgroundResource( R.drawable.arrow_up); });
That is the way to change the arrow up and arrow down