boolean pageScroll(int direction){
  int nextPage=-1;
  boolean down=false;
  if (direction == FOCUS_UP) {
    nextPage=Math.max(0,mSelectedPosition - getChildCount() - 1);
  }
 else   if (direction == FOCUS_DOWN) {
    nextPage=Math.min(mItemCount - 1,mSelectedPosition + getChildCount() - 1);
    down=true;
  }
  if (nextPage >= 0) {
    int position=lookForSelectablePosition(nextPage,down);
    if (position >= 0) {
      mLayoutMode=LAYOUT_SPECIFIC;
      mSpecificLeft=getPaddingLeft() + getHorizontalFadingEdgeLength();
      if (down && position > mItemCount - getChildCount()) {
        mLayoutMode=LAYOUT_FORCE_RIGHT;
      }
      if (!down && position < getChildCount()) {
        mLayoutMode=LAYOUT_FORCE_LEFT;
      }
      setSelectionInt(position);
      invokeOnItemScrollListener();
      if (!awakenScrollBars()) {
        invalidate();
      }
      return true;
    }
  }
  return false;
}

boolean pageScroll ( int direction ) { int nextPage = - 1 ; boolean down = false ; if ( direction == FOCUS_UP ) { nextPage = Math . max ( 0 , mSelectedPosition - getChildCount ( ) - 1 ) ; } else if ( direction == FOCUS_DOWN ) { nextPage = Math . min ( mItemCount - 1 , mSelectedPosition + getChildCount ( ) - 1 ) ; down = true ; } if ( nextPage >= 0 ) { int position = lookForSelectablePosition ( nextPage , down ) ; if ( position >= 0 ) { mLayoutMode = LAYOUT_SPECIFIC ; mSpecificLeft = getPaddingLeft ( ) + getHorizontalFadingEdgeLength ( ) ; if ( down && position > mItemCount - getChildCount ( ) ) { mLayoutMode = LAYOUT_FORCE_RIGHT ; } if ( ! down && position < getChildCount ( ) ) { mLayoutMode = LAYOUT_FORCE_LEFT ; } setSelectionInt ( position ) ; invokeOnItemScrollListener ( ) ; if ( ! awakenScrollBars ( ) ) { invalidate ( ) ; } return true ; } } return false ; }
scrolls left or right by the number of items currently present on screen .
