Android SectionIndexer - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android SectionIndexer class.

This code example shows how to use the following methods:getPositionForSection, getSectionForPosition, getSections
    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 

7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getPositionForSection
This code example shows how to use the following methods:getPositionForSection
				mDialogText.setVisibility(View.VISIBLE);
				mDialogText.setText("" + l[idx]);
				if (sectionIndexter == null) {
					sectionIndexter = (SectionIndexer) list.getAdapter();
				} 
				int position = sectionIndexter.getPositionForSection(l[idx]);
				if (position == -1) {
					return true; 
				} 
				list.setSelection(position);
			} else { 
				mDialogText.setVisibility(View.INVISIBLE);
			} 
		} 
		return true; 
	} 
 
	protected void onDraw(Canvas canvas) {
		Paint paint = new Paint();
		paint.setColor(0xff595c61);
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getPositionForSection, getSectionForPosition, getSections
    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 

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getPositionForSection
			mDialogText.setText("" + l[idx]);
			if (sectionIndexter == null)
			{ 
				sectionIndexter = (SectionIndexer) list.getAdapter();
			} 
			int position = sectionIndexter.getPositionForSection(l[idx]);
			if (position == -1)
			{ 
				return true; 
			} 
			list.setSelection(position);
		} else 
		{ 
			mDialogText.setVisibility(View.INVISIBLE);
		} 
		return true; 
	} 
 
	protected void onDraw(Canvas canvas) {
		Paint paint = new Paint();
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getPositionForSection, getSectionForPosition, getSections
    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 

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getPositionForSection
			mDialogText.setText("" + l[idx]);
			if (sectionIndexter == null)
			{ 
				sectionIndexter = (SectionIndexer) list.getAdapter();
			} 
			int position = sectionIndexter.getPositionForSection(l[idx]);
			if (position == -1)
			{ 
				return true; 
			} 
			list.setSelection(position);
		} else 
		{ 
			mDialogText.setVisibility(View.INVISIBLE);
		} 
		return true; 
	} 
 
	protected void onDraw(Canvas canvas) {
		Paint paint = new Paint();
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getPositionForSection, getSectionForPosition, getSections
    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 

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getPositionForSection
			mDialogText.setVisibility(View.VISIBLE);
			mDialogText.setText("" + alpha[idx]);
			if (sectionIndexter == null) {
				sectionIndexter = (SectionIndexer) list.getAdapter();
			} 
			int position = sectionIndexter.getPositionForSection(alpha[idx]);
			if (position == -1) {
				return true; 
			} 
			list.setSelection(position);
		} else { 
			mDialogText.setVisibility(View.INVISIBLE);
		} 
		return true; 
	} 
 
	protected void onDraw(Canvas canvas) {
		Paint paint = new Paint();
		paint.setColor(Color.parseColor("#4f86ad"));
		paint.setTextSize(24);
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getPositionForSection
			mDialogText.setVisibility(View.VISIBLE);
			mDialogText.setText("" + l[idx]);
			if (sectionIndexter == null) {
				sectionIndexter = (SectionIndexer) list.getAdapter();
			} 
			int position = sectionIndexter.getPositionForSection(l[idx]);
			if (position == -1) {
				return true; 
			} 
			list.setSelection(position);
		} else { 
			mDialogText.setVisibility(View.INVISIBLE);
		} 
		return true; 
	} 
 
	public void setListView(ListView _list) {
		list = _list;
		sectionIndexter = (SectionIndexer) _list.getAdapter();
	} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Android SectionIndexer Questions & Answers:

See Code Examples for Android SectionIndexer Methods: