diff options
author | Ran Zhengyuan <ranzhengyuan@gmail.com> | 2014-01-11 21:37:02 +0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2014-12-04 17:05:59 +0000 |
commit | eb45d3cef394816e6d036aa6d54a53aa39b0089f (patch) | |
tree | 40c508f1a0470d614705741297f465f58431dbdd | |
parent | ffb6b0d7d1fe9e569bf570bc238eef99ad224a7a (diff) | |
download | android_packages_apps_ContactsCommon-eb45d3cef394816e6d036aa6d54a53aa39b0089f.tar.gz android_packages_apps_ContactsCommon-eb45d3cef394816e6d036aa6d54a53aa39b0089f.tar.bz2 android_packages_apps_ContactsCommon-eb45d3cef394816e6d036aa6d54a53aa39b0089f.zip |
The FastScroller is not working properly.
If you have a large number of contacts in the last section of contacts list,
when you scroll the list, the fast scroll bar will work improperly, it will scroll back.
The reason is that when we scroll to the last section, the next position of the next section is -1 but not the count of the contacts.
Change-Id: I058b3e6c88e8aaeabbfed291296e02dfd775018e
-rw-r--r-- | src/com/android/contacts/common/list/ContactsSectionIndexer.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/contacts/common/list/ContactsSectionIndexer.java b/src/com/android/contacts/common/list/ContactsSectionIndexer.java index 8d1c9e1d..bada56c2 100644 --- a/src/com/android/contacts/common/list/ContactsSectionIndexer.java +++ b/src/com/android/contacts/common/list/ContactsSectionIndexer.java @@ -71,8 +71,10 @@ public class ContactsSectionIndexer implements SectionIndexer { } public int getPositionForSection(int section) { - if (section < 0 || section >= mSections.length) { + if (section < 0 || section > mSections.length) { return -1; + } else if (section == mSections.length) { + return mCount; } return mPositions[section]; |