private View fillSpecific(int position,int top){
  if (DEBUG)   Log.i(TAG,"fillSpecific() position: " + position + " top: "+ top+ M_FIRST_POSITION+ mFirstPosition);
  final int numColumns=mNumColumns;
  int motionRowStart;
  int motionRowEnd=-1;
  if (!mStackFromBottom) {
    motionRowStart=position - (position % numColumns);
  }
 else {
    final int invertedSelection=mItemCount - 1 - position;
    motionRowEnd=mItemCount - 1 - (invertedSelection - (invertedSelection % numColumns));
    motionRowStart=Math.max(0,motionRowEnd - numColumns + 1);
  }
  final View temp=makeRow(mStackFromBottom ? motionRowEnd : motionRowStart,top,true);
  mFirstPosition=motionRowStart;
  final View referenceView=mReferenceView;
  if (referenceView == null) {
    return null;
  }
  final int verticalSpacing=mVerticalSpacing;
  View above;
  View below;
  if (!mStackFromBottom) {
    above=fillUp(motionRowStart - numColumns,referenceView.getTop() - verticalSpacing);
    adjustViewsUpOrDown();
    below=fillDown(motionRowStart + numColumns,referenceView.getBottom() + verticalSpacing);
    final int childCount=getChildCount();
    if (childCount > 0) {
      correctTooHigh(numColumns,verticalSpacing,childCount);
    }
  }
 else {
    below=fillDown(motionRowEnd + numColumns,referenceView.getBottom() + verticalSpacing);
    adjustViewsUpOrDown();
    above=fillUp(motionRowStart - 1,referenceView.getTop() - verticalSpacing);
    final int childCount=getChildCount();
    if (childCount > 0) {
      correctTooLow(numColumns,verticalSpacing,childCount);
    }
  }
  if (temp != null) {
    return temp;
  }
 else   if (above != null) {
    return above;
  }
 else {
    return below;
  }
}

private View fillSpecific ( int position , int top ) { if ( DEBUG ) Log . i ( TAG , "fillSpecific() position: " + position + " top: " + top + M_FIRST_POSITION + mFirstPosition ) ; final int numColumns = mNumColumns ; int motionRowStart ; int motionRowEnd = - 1 ; if ( ! mStackFromBottom ) { motionRowStart = position - ( position % numColumns ) ; } else { final int invertedSelection = mItemCount - 1 - position ; motionRowEnd = mItemCount - 1 - ( invertedSelection - ( invertedSelection % numColumns ) ) ; motionRowStart = Math . max ( 0 , motionRowEnd - numColumns + 1 ) ; } final View temp = makeRow ( mStackFromBottom ? motionRowEnd : motionRowStart , top , true ) ; mFirstPosition = motionRowStart ; final View referenceView = mReferenceView ; if ( referenceView == null ) { return null ; } final int verticalSpacing = mVerticalSpacing ; View above ; View below ; if ( ! mStackFromBottom ) { above = fillUp ( motionRowStart - numColumns , referenceView . getTop ( ) - verticalSpacing ) ; adjustViewsUpOrDown ( ) ; below = fillDown ( motionRowStart + numColumns , referenceView . getBottom ( ) + verticalSpacing ) ; final int childCount = getChildCount ( ) ; if ( childCount > 0 ) { correctTooHigh ( numColumns , verticalSpacing , childCount ) ; } } else { below = fillDown ( motionRowEnd + numColumns , referenceView . getBottom ( ) + verticalSpacing ) ; adjustViewsUpOrDown ( ) ; above = fillUp ( motionRowStart - 1 , referenceView . getTop ( ) - verticalSpacing ) ; final int childCount = getChildCount ( ) ; if ( childCount > 0 ) { correctTooLow ( numColumns , verticalSpacing , childCount ) ; } } if ( temp != null ) { return temp ; } else if ( above != null ) { return above ; } else { return below ; } }
layout during a scroll that results from tracking motion events . places the mmotionposition view at the offset specified by mmotionviewtop , and then build surrounding views from there .
