ExpandableLayout icon indicating copy to clipboard operation
ExpandableLayout copied to clipboard

when expanding or Collapsing, never calling renderParent

Open xiayu98020214 opened this issue 7 years ago • 2 comments

when expanding or Collapsing, never calling renderParent

xiayu98020214 avatar Sep 26 '17 02:09 xiayu98020214

I have the same issue.....can't change the collapse image

norrisboat avatar Oct 15 '17 20:10 norrisboat

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

sanxy avatar Mar 31 '20 15:03 sanxy