Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 484a6c5b authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Make FastScroller behave kinder and gentler when an app decides to...

Merge "Make FastScroller behave kinder and gentler when an app decides to return null from SectionIndexer#getSections()"
parents 5ab3cbc9 f49971ec
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -468,7 +468,9 @@ class FastScroller {
                mListAdapter = (BaseAdapter) adapter;
                mListAdapter = (BaseAdapter) adapter;
                mSectionIndexer = (SectionIndexer) adapter;
                mSectionIndexer = (SectionIndexer) adapter;
                mSections = mSectionIndexer.getSections();
                mSections = mSectionIndexer.getSections();
                
                if (mSections == null) {
                    mSections = new String[] { " " };
                }
            } else {
            } else {
                mListAdapter = (BaseAdapter) adapter;
                mListAdapter = (BaseAdapter) adapter;
                mSections = new String[] { " " };
                mSections = new String[] { " " };
@@ -609,7 +611,7 @@ class FastScroller {
        final int section = mSectionIndexer.getSectionForPosition(firstVisibleItem);
        final int section = mSectionIndexer.getSectionForPosition(firstVisibleItem);
        final int sectionPos = mSectionIndexer.getPositionForSection(section);
        final int sectionPos = mSectionIndexer.getPositionForSection(section);
        final int nextSectionPos = mSectionIndexer.getPositionForSection(section + 1);
        final int nextSectionPos = mSectionIndexer.getPositionForSection(section + 1);
        final int sectionCount = mSectionIndexer.getSections().length;
        final int sectionCount = mSections.length;
        final int positionsInSection = nextSectionPos - sectionPos;
        final int positionsInSection = nextSectionPos - sectionPos;


        final View child = mList.getChildAt(0);
        final View child = mList.getChildAt(0);