Code example for ListAdapter

Methods: getItemViewType

0
 
    @Override 
    public int getItemViewType(int position) {
        return isSectionHeaderPosition(position)
                ? getViewTypeCount() - 1 
                : mBaseAdapter.getItemViewType(position);
    } 
 
    @Override 
    public boolean isEnabled(int position) {
        //noinspection SimplifiableConditionalExpression 
        return isSectionHeaderPosition(position)
                ? false 
                : mBaseAdapter.isEnabled(sectionedPositionToPosition(position));
    } 
 
    @Override 
    public int getViewTypeCount() { 
        return mBaseAdapter.getViewTypeCount() + 1; // the section headings
    }