interpolateOutOfBoundsScroll

open fun interpolateOutOfBoundsScroll(@NonNull recyclerView: RecyclerView, viewSize: Int, viewSizeOutOfBounds: Int, totalSize: Int, msSinceStartScroll: Long): Int(source)

Called by the ItemTouchHelper when user is dragging a view out of bounds.

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.

Return

The amount that RecyclerView should scroll. Keep in mind that this value will be passed to scrollBy method.

Parameters

recyclerView

The RecyclerView instance to which ItemTouchHelper is attached to.

viewSize

The total size of the View in scroll direction, excluding item decorations.

viewSizeOutOfBounds

The total size of the View that is out of bounds. This value is negative if the View is dragged towards left or top edge.

totalSize

The total size of RecyclerView in the scroll direction.

msSinceStartScroll

The time passed since View is kept out of bounds.