Code example for SectionIndexer

Methods: getPositionForSection, getSectionForPosition, getSections

0
 
    public Object[] getSections() {
        if (mIndexer == null) {
            return new String[] { " " };
        } else { 
            return mIndexer.getSections();
        } 
    } 
 
    /** 
     * @return relative position of the section in the indexed partition 
     */ 
    public int getPositionForSection(int sectionIndex) {
        if (mIndexer == null) {
            return -1; 
        } 
 
        return mIndexer.getPositionForSection(sectionIndex);
    } 
 
    /** 
     * @param position relative position in the indexed partition 
     */ 
    public int getSectionForPosition(int position) {
        if (mIndexer == null) {
            return -1; 
        } 
 
        return mIndexer.getSectionForPosition(position);
    } 
 
    @Override 
    public int getPinnedHeaderCount() { 
        if (isSectionHeaderDisplayEnabled()) {