@Override int lookForSelectablePosition(int position,boolean lookDown){
  final ListAdapter adapter=mAdapter;
  if (adapter == null || isInTouchMode()) {
    return INVALID_POSITION;
  }
  final int count=adapter.getCount();
  if (!mAreAllItemsSelectable) {
    if (lookDown) {
      position=Math.max(0,position);
      while (position < count && !adapter.isEnabled(position)) {
        position++;
      }
    }
 else {
      position=Math.min(position,count - 1);
      while (position >= 0 && !adapter.isEnabled(position)) {
        position--;
      }
    }
    if (position < 0 || position >= count) {
      return INVALID_POSITION;
    }
    return position;
  }
 else {
    if (position < 0 || position >= count) {
      return INVALID_POSITION;
    }
    return position;
  }
}

@ Override int lookForSelectablePosition ( int position , boolean lookDown ) { final ListAdapter adapter = mAdapter ; if ( adapter == null || isInTouchMode ( ) ) { return INVALID_POSITION ; } final int count = adapter . getCount ( ) ; if ( ! mAreAllItemsSelectable ) { if ( lookDown ) { position = Math . max ( 0 , position ) ; while ( position < count && ! adapter . isEnabled ( position ) ) { position ++ ; } } else { position = Math . min ( position , count - 1 ) ; while ( position >= 0 && ! adapter . isEnabled ( position ) ) { position -- ; } } if ( position < 0 || position >= count ) { return INVALID_POSITION ; } return position ; } else { if ( position < 0 || position >= count ) { return INVALID_POSITION ; } return position ; } }
find a position that can be selected ( i . e . , is not a separator ) .
