Merge "Fix bug 5199326 - ListView's fast scroller is out of sync with contents"

This commit is contained in:
Adam Powell
2011-08-25 15:26:36 -07:00
committed by Android (Google) Code Review

View File

@@ -368,8 +368,10 @@ class FastScroller {
} else if (mState == STATE_EXIT) { } else if (mState == STATE_EXIT) {
if (alpha == 0) { // Done with exit if (alpha == 0) { // Done with exit
setState(STATE_NONE); setState(STATE_NONE);
} else if (mTrackDrawable != null) {
mList.invalidate(viewWidth - mThumbW, 0, viewWidth, mList.getHeight());
} else { } else {
mList.invalidate(viewWidth - mThumbW, y, viewWidth, y + mThumbH); mList.invalidate(viewWidth - mThumbW, y, viewWidth, y + mThumbH);
} }
} }
} }
@@ -597,7 +599,7 @@ class FastScroller {
private int getThumbPositionForListPosition(int firstVisibleItem, int visibleItemCount, private int getThumbPositionForListPosition(int firstVisibleItem, int visibleItemCount,
int totalItemCount) { int totalItemCount) {
if (mSectionIndexer == null) { if (mSectionIndexer == null || mListAdapter == null) {
getSectionsFromIndexer(); getSectionsFromIndexer();
} }
if (mSectionIndexer == null || !mMatchDragPosition) { if (mSectionIndexer == null || !mMatchDragPosition) {