tags:

views:

9

answers:

0

How do I get index of first/last visible group in an ExpandableListView?

getFirstVisiblePosition() and getLastVisiblePosition() are mostly useless for ExpandableListViews, because they return the index of the first/last visible cell in the list. Which makes a difference because expanded groups count as multiple cells.

What I do need is either some methods like getFirstVisibleGroupIndex(), getLastVisibleGroupIndex() or some method to convert the "visible cell index" value from the methods above to a real group(+child) index value.

Note: OnScrollListener.onScroll(..., int firstVisibleItem, int visibleItemCount, ...) suffers from the same problem if the listener is set on an ExpandableListView.