public void checkChild(boolean checked, int groupIndex, int childIndex) { CheckedExpandableGroup group = (CheckedExpandableGroup) expandableList.groups.get(groupIndex); group.onChildClicked(childIndex, checked); if (childrenUpdateListener != null) { //only update children check states if group is expanded boolean isGroupExpanded = expandableList.expandedGroupIndexes[groupIndex]; if (isGroupExpanded) { childrenUpdateListener.updateChildrenCheckState( expandableList.getFlattenedFirstChildIndex(groupIndex), group.getItemCount()); } } }
/** * Triggered by a click event on a {@link CheckableChildViewHolder} causing the {@link Checkable} * object to change checked states * * @param checked The current checked state of the view * @param listPosition The flat position (raw index) of the {@link CheckableChildViewHolder} */ public void onChildCheckChanged(boolean checked, ExpandableListPosition listPosition) { CheckedExpandableGroup group = (CheckedExpandableGroup) expandableList.groups.get(listPosition.groupPos); group.onChildClicked(listPosition.childPos, checked); if (childrenUpdateListener != null) { childrenUpdateListener.updateChildrenCheckState( expandableList.getFlattenedFirstChildIndex(listPosition), expandableList.getExpandableGroupItemCount(listPosition)); } }
public void clearChoices() { childCheckController.clearCheckStates(); //only update the child views that are visible (i.e. their group is expanded) for (int i = 0; i < getGroups().size(); i++) { ExpandableGroup group = getGroups().get(i); if (isGroupExpanded(group)) { notifyItemRangeChanged(expandableList.getFlattenedFirstChildIndex(i), group.getItemCount()); } } }
/** * Clear any choices previously checked */ public void clearChoices() { childCheckController.clearCheckStates(); //only update the child views that are visible (i.e. their group is expanded) for (int i = 0; i < getGroups().size(); i++) { ExpandableGroup group = getGroups().get(i); if (isGroupExpanded(group)) { notifyItemRangeChanged(expandableList.getFlattenedFirstChildIndex(i), group.getItemCount()); } } }