Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From what I can tell, the issue is that your <code>SectionIndexer</code> implementation is unbalanced. Currently you have:</p> <pre><code> public int getPositionForSection(int section) { return _alphaIndexer.get(_sections[section]); } public int getSectionForPosition(int position) { return 0; } public Object[] getSections() { return _sections; } </code></pre> <p>There is a workable implementation telling the list how to determine the position of where a given section begins in <code>getPositionForSection()</code>, but nothing about how to determine which section a given position is located in <code>getSectionForPosition()</code>.</p> <p>When I run a simplified example (on my GTab 10.1 with Android 3.1) using this indexer code I can easily get the scroller handle to go completely off-screen so a user can't get it at all without scrolling all the way to the top of the list. The way to fix this is to balance the indexer by implementing the other method properly:</p> <pre><code> public int getPositionForSection(int section) { return _alphaIndexer.get(_sections[section]); } public int getSectionForPosition(int position) { //Iterate over the sections to find the closest index //that is not greater than the position int closestIndex = 0; int latestDelta = Integer.MAX_VALUE; for(int i=0; i &lt; _sections.length; i++) { int current = _alphaIndexer.get(_sections[i]); if(current == position) { //If position matches an index, return it immediately return i; } else if(current &lt; position) { //Check if this is closer than the last index we inspected int delta = position - current; if(delta &lt; latestDelta) { closestIndex = i; latestDelta = delta; } } } return closestIndex; } public Object[] getSections() { return _sections; } </code></pre> <p>In my example anyway, fixing the <code>SectionIndexer</code> to be more balanced eliminates the issue and the scroll handle never goes below the view. This example code may not work copy/paste for your data source, but it should give you an idea of how to put it into your code.</p> <p>HTH</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload