Skip to content

Commit be6e6e4

Browse files
committed
- NotifyParentChanged() is added.
1 parent 5a7b1ed commit be6e6e4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

expandablelib/src/main/java/iammert/com/expandablelib/ExpandableLayout.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,17 @@ public void onClick(View view) {
193193
addView(sectionLayout);
194194
}
195195

196+
public void notifyParentChanged(int position) {
197+
if (position > getChildCount() - 1) {
198+
return;
199+
}
200+
ViewGroup viewGroup = (ViewGroup) getChildAt(position);
201+
if (viewGroup != null && viewGroup.getChildCount() > 0) {
202+
View parentView = viewGroup.getChildAt(0);
203+
renderer.renderParent(parentView, sections.get(position).parent, sections.get(position).expanded, position);
204+
}
205+
}
206+
196207
private <P> void expand(@NonNull P parent) {
197208
for (int i = 0; i < sections.size(); i++) {
198209
if (parent.equals(sections.get(i).parent)) {

0 commit comments

Comments
 (0)