Prevent overflow in FastScroller indexing

Change-Id: I53f90feaefd49717a0bdaddcf9a4988318d40c7d
This commit is contained in:
Adam Powell
2011-03-09 16:35:13 -08:00
parent 5fa7aac81b
commit 7ee1ff1450

View File

@ -564,6 +564,9 @@ class FastScroller {
}
} else {
int index = (int) (position * count);
// Don't overflow
if (index > count - 1) index = count - 1;
if (mList instanceof ExpandableListView) {
ExpandableListView expList = (ExpandableListView) mList;
expList.setSelectionFromTop(expList.getFlatListPosition(