public virtual bool isEnabled(int position) { android.widget.ListAdapter adapter = mListAdapter; if (adapter != null) { return(adapter.isEnabled(position)); } else { return(true); } }
public virtual bool isEnabled(int position) { // Header (negative positions will throw an ArrayIndexOutOfBoundsException) int numHeaders = getHeadersCount(); if (position < numHeaders) { return(mHeaderViewInfos.get(position).isSelectable); } // Adapter int adjPosition = position - numHeaders; int adapterCount = 0; if (mAdapter != null) { adapterCount = mAdapter.getCount(); if (adjPosition < adapterCount) { return(mAdapter.isEnabled(adjPosition)); } } // Footer (off-limits positions will throw an ArrayIndexOutOfBoundsException) return(mFooterViewInfos.get(adjPosition - adapterCount).isSelectable); }