boolean trackMotionScroll(int deltaY,int incrementalDeltaY){
  final int childCount=getChildCount();
  if (childCount == 0) {
    return true;
  }
  final int firstTop=getScrollChildTop();
  final int lastBottom=getScrollChildBottom();
  final Rect listPadding=mListPadding;
  final int end=getHeight() - listPadding.bottom;
  final int spaceAbove=listPadding.top - getFillChildTop();
  final int spaceBelow=getFillChildBottom() - end;
  final int height=getHeight() - getPaddingBottom() - getPaddingTop();
  if (deltaY < 0) {
    deltaY=Math.max(-(height - 1),deltaY);
  }
 else {
    deltaY=Math.min(height - 1,deltaY);
  }
  if (incrementalDeltaY < 0) {
    incrementalDeltaY=Math.max(-(height - 1),incrementalDeltaY);
  }
 else {
    incrementalDeltaY=Math.min(height - 1,incrementalDeltaY);
  }
  final int firstPosition=mFirstPosition;
  if (firstPosition == 0 && firstTop >= listPadding.top && deltaY >= 0) {
    return true;
  }
  if (firstPosition + childCount == mItemCount && lastBottom <= end && deltaY <= 0) {
    return true;
  }
  final boolean down=incrementalDeltaY < 0;
  final int headerViewsCount=getHeaderViewsCount();
  final int footerViewsStart=mItemCount - getFooterViewsCount();
  int start=0;
  int count=0;
  if (down) {
    final int top=listPadding.top - incrementalDeltaY;
    for (int i=0; i < childCount; i++) {
      final View child=getChildAt(i);
      if (child.getBottom() >= top) {
        break;
      }
 else {
        count++;
        int position=firstPosition + i;
        if (position >= headerViewsCount && position < footerViewsStart) {
          mRecycler.addScrapView(child);
          if (ViewDebug.TRACE_RECYCLER) {
            ViewDebug.trace(child,ViewDebug.RecyclerTraceType.MOVE_TO_SCRAP_HEAP,firstPosition + i,-1);
          }
        }
      }
    }
  }
 else {
    final int bottom=getHeight() - listPadding.bottom - incrementalDeltaY;
    for (int i=childCount - 1; i >= 0; i--) {
      final View child=getChildAt(i);
      if (child.getTop() <= bottom) {
        break;
      }
 else {
        start=i;
        count++;
        int position=firstPosition + i;
        if (position >= headerViewsCount && position < footerViewsStart) {
          mRecycler.addScrapView(child);
          if (ViewDebug.TRACE_RECYCLER) {
            ViewDebug.trace(child,ViewDebug.RecyclerTraceType.MOVE_TO_SCRAP_HEAP,firstPosition + i,-1);
          }
        }
      }
    }
  }
  mMotionViewNewTop=mMotionViewOriginalTop + deltaY;
  mBlockLayoutRequests=true;
  if (count > 0) {
    detachViewsFromParent(start,count);
  }
  tryOffsetChildrenTopAndBottom(incrementalDeltaY);
  if (down) {
    mFirstPosition+=count;
  }
  invalidate();
  final int absIncrementalDeltaY=Math.abs(incrementalDeltaY);
  if (spaceAbove < absIncrementalDeltaY || spaceBelow < absIncrementalDeltaY) {
    fillGap(down);
  }
  mBlockLayoutRequests=false;
  invokeOnItemScrollListener();
  awakenScrollBars();
  return false;
}

boolean trackMotionScroll ( int deltaY , int incrementalDeltaY ) { final int childCount = getChildCount ( ) ; if ( childCount == 0 ) { return true ; } final int firstTop = getScrollChildTop ( ) ; final int lastBottom = getScrollChildBottom ( ) ; final Rect listPadding = mListPadding ; final int end = getHeight ( ) - listPadding . bottom ; final int spaceAbove = listPadding . top - getFillChildTop ( ) ; final int spaceBelow = getFillChildBottom ( ) - end ; final int height = getHeight ( ) - getPaddingBottom ( ) - getPaddingTop ( ) ; if ( deltaY < 0 ) { deltaY = Math . max ( - ( height - 1 ) , deltaY ) ; } else { deltaY = Math . min ( height - 1 , deltaY ) ; } if ( incrementalDeltaY < 0 ) { incrementalDeltaY = Math . max ( - ( height - 1 ) , incrementalDeltaY ) ; } else { incrementalDeltaY = Math . min ( height - 1 , incrementalDeltaY ) ; } final int firstPosition = mFirstPosition ; if ( firstPosition == 0 && firstTop >= listPadding . top && deltaY >= 0 ) { return true ; } if ( firstPosition + childCount == mItemCount && lastBottom <= end && deltaY <= 0 ) { return true ; } final boolean down = incrementalDeltaY < 0 ; final int headerViewsCount = getHeaderViewsCount ( ) ; final int footerViewsStart = mItemCount - getFooterViewsCount ( ) ; int start = 0 ; int count = 0 ; if ( down ) { final int top = listPadding . top - incrementalDeltaY ; for ( int i = 0 ; i < childCount ; i ++ ) { final View child = getChildAt ( i ) ; if ( child . getBottom ( ) >= top ) { break ; } else { count ++ ; int position = firstPosition + i ; if ( position >= headerViewsCount && position < footerViewsStart ) { mRecycler . addScrapView ( child ) ; if ( ViewDebug . TRACE_RECYCLER ) { ViewDebug . trace ( child , ViewDebug . RecyclerTraceType . MOVE_TO_SCRAP_HEAP , firstPosition + i , - 1 ) ; } } } } } else { final int bottom = getHeight ( ) - listPadding . bottom - incrementalDeltaY ; for ( int i = childCount - 1 ; i >= 0 ; i -- ) { final View child = getChildAt ( i ) ; if ( child . getTop ( ) <= bottom ) { break ; } else { start = i ; count ++ ; int position = firstPosition + i ; if ( position >= headerViewsCount && position < footerViewsStart ) { mRecycler . addScrapView ( child ) ; if ( ViewDebug . TRACE_RECYCLER ) { ViewDebug . trace ( child , ViewDebug . RecyclerTraceType . MOVE_TO_SCRAP_HEAP , firstPosition + i , - 1 ) ; } } } } } mMotionViewNewTop = mMotionViewOriginalTop + deltaY ; mBlockLayoutRequests = true ; if ( count > 0 ) { detachViewsFromParent ( start , count ) ; } tryOffsetChildrenTopAndBottom ( incrementalDeltaY ) ; if ( down ) { mFirstPosition += count ; } invalidate ( ) ; final int absIncrementalDeltaY = Math . abs ( incrementalDeltaY ) ; if ( spaceAbove < absIncrementalDeltaY || spaceBelow < absIncrementalDeltaY ) { fillGap ( down ) ; } mBlockLayoutRequests = false ; invokeOnItemScrollListener ( ) ; awakenScrollBars ( ) ; return false ; }
track a motion scroll
