am fa42e774: Merge "FastScroller: Fix to use appropriate index"

* commit 'fa42e774bc48c3172023c8c49610baa469c19e39':
  FastScroller: Fix to use appropriate index
This commit is contained in:
Jean-Baptiste Queru
2013-07-08 14:28:45 -07:00
committed by Android Git Automerger

View File

@@ -676,8 +676,13 @@ class FastScroller {
final int section = mSectionIndexer.getSectionForPosition(firstVisibleItem);
final int sectionPos = mSectionIndexer.getPositionForSection(section);
final int nextSectionPos = mSectionIndexer.getPositionForSection(section + 1);
final int nextSectionPos;
final int sectionCount = mSections.length;
if (section + 1 < sectionCount) {
nextSectionPos = mSectionIndexer.getPositionForSection(section + 1);
} else {
nextSectionPos = totalItemCount - 1;
}
final int positionsInSection = nextSectionPos - sectionPos;
final View child = mList.getChildAt(0);