public int interpolateOutOfBoundsScroll(RecyclerView recyclerView,int viewSize,int viewSizeOutOfBounds,int totalSize,long msSinceStartScroll){
  final int maxScroll=getMaxDragScroll(recyclerView);
  final int absOutOfBounds=Math.abs(viewSizeOutOfBounds);
  final int direction=(int)Math.signum(viewSizeOutOfBounds);
  float outOfBoundsRatio=Math.min(1f,1f * absOutOfBounds / viewSize);
  final int cappedScroll=(int)(direction * maxScroll * sDragViewScrollCapInterpolator.getInterpolation(outOfBoundsRatio));
  final float timeRatio;
  if (msSinceStartScroll > DRAG_SCROLL_ACCELERATION_LIMIT_TIME_MS) {
    timeRatio=1f;
  }
 else {
    timeRatio=(float)msSinceStartScroll / DRAG_SCROLL_ACCELERATION_LIMIT_TIME_MS;
  }
  final int value=(int)(cappedScroll * sDragScrollInterpolator.getInterpolation(timeRatio));
  if (value == 0) {
    return viewSizeOutOfBounds > 0 ? 1 : -1;
  }
  return value;
}

public int interpolateOutOfBoundsScroll ( RecyclerView recyclerView , int viewSize , int viewSizeOutOfBounds , int totalSize , long msSinceStartScroll ) { final int maxScroll = getMaxDragScroll ( recyclerView ) ; final int absOutOfBounds = Math . abs ( viewSizeOutOfBounds ) ; final int direction = ( int ) Math . signum ( viewSizeOutOfBounds ) ; float outOfBoundsRatio = Math . min ( 1f , 1f * absOutOfBounds / viewSize ) ; final int cappedScroll = ( int ) ( direction * maxScroll * sDragViewScrollCapInterpolator . getInterpolation ( outOfBoundsRatio ) ) ; final float timeRatio ; if ( msSinceStartScroll > DRAG_SCROLL_ACCELERATION_LIMIT_TIME_MS ) { timeRatio = 1f ; } else { timeRatio = ( float ) msSinceStartScroll / DRAG_SCROLL_ACCELERATION_LIMIT_TIME_MS ; } final int value = ( int ) ( cappedScroll * sDragScrollInterpolator . getInterpolation ( timeRatio ) ) ; if ( value == 0 ) { return viewSizeOutOfBounds > 0 ? 1 : - 1 ; } return value ; }
called by the itemtouchhelper when user is dragging a view out of bounds . < p / > you can override this method to decide how much recyclerview should scroll in response to this action . default implementation calculates a value based on the amount of view out of bounds and the time it spent there . the longer user keeps the view out of bounds , the faster the list will scroll . similarly , the larger portion of the view is out of bounds , the faster the recyclerview will scroll .
