@Override
 public boolean isEnabled(int position) {
   //noinspection SimplifiableConditionalExpression
   return isSectionHeaderPosition(position)
       ? false
       : mBaseAdapter.isEnabled(sectionedPositionToPosition(position));
 }
예제 #2
0
 public boolean isEnabled(int i) {
   ListAdapter listadapter = b;
   if (listadapter != null) {
     return listadapter.isEnabled(i);
   } else {
     return true;
   }
 }
예제 #3
0
  /**
   * Returns true if the item at the specified position is not a separator.
   *
   * @param position Position of the item whose data we want
   */
  @Override
  public boolean isEnabled(int position) {
    for (ListAdapter piece : pieces) {
      int size = piece.getCount();

      if (position < size) {
        return (piece.isEnabled(position));
      }

      position -= size;
    }

    return (false);
  }
  public boolean isEnabled(int position) {
    // Header (negative positions will throw an ArrayIndexOutOfBoundsException)
    int numHeaders = getHeadersCount();
    if (position < numHeaders) {
      return mHeaderViewInfos.get(position).isSelectable;
    }

    // Adapter
    final 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;
  }
예제 #5
0
 @Override
 public boolean isEnabled(int position) {
   // Header (negative positions will throw an
   // ArrayIndexOutOfBoundsException)
   int numHeadersAndPlaceholders = getHeadersCount() * mNumColumns;
   if (position < numHeadersAndPlaceholders) {
     return (position % mNumColumns == 0)
         && mHeaderViewInfos.get(position / mNumColumns).isSelectable;
   }
   // Adapter
   final int adjPosition = position - numHeadersAndPlaceholders;
   int adapterCount = 0;
   if (mAdapter != null) {
     adapterCount = mAdapter.getCount();
     if (adjPosition < adapterCount) {
       return mAdapter.isEnabled(adjPosition);
     }
   }
   throw new ArrayIndexOutOfBoundsException(position);
 }
    @Override
    public boolean isEnabled(int position) {
      // Header (negative positions will throw an IndexOutOfBoundsException)
      int numHeadersAndPlaceholders = getHeadersCount() * mNumColumns;
      if (position < numHeadersAndPlaceholders) {
        return position % mNumColumns == 0
            && mHeaderViewInfos.get(position / mNumColumns).isSelectable;
      }

      // Adapter
      final int adjPosition = position - numHeadersAndPlaceholders;
      int adapterCount = 0;
      if (mAdapter != null) {
        adapterCount = getAdapterAndPlaceHolderCount();
        if (adjPosition < adapterCount) {
          return adjPosition < mAdapter.getCount() && mAdapter.isEnabled(adjPosition);
        }
      }

      // Footer (off-limits positions will throw an IndexOutOfBoundsException)
      final int footerPosition = adjPosition - adapterCount;
      return footerPosition % mNumColumns == 0
          && mFooterViewInfos.get(footerPosition / mNumColumns).isSelectable;
    }
예제 #7
0
 @Override
 public boolean isEnabled(final int position) {
   return wrapped.isEnabled(position);
 }
예제 #8
0
 @Override
 public boolean isEnabled(final int position) {
   return isSectionHeaderPosition(position)
       ? false
       : mBaseAdapter.isEnabled(sectionedPositionToPosition(position));
 }
예제 #9
0
 @Override
 public boolean isEnabled(int position) {
   return mAdapter.isEnabled(position);
 }