public final boolean isParentItem ( int adapterPosition ) { int itemCount = 0 ; int parentCount = parentItemCount ( ) ; for ( int i = 0 ; i < parentCount ; i ++ ) { if ( itemCount == adapterPosition ) { return true ; } itemCount += 1 ; if ( isExpanded ( i ) ) { itemCount += childItemCount ( i ) ; } else { // itemCount += 1; } } return false ; }
Item is a parent item .