onScrolled

open fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int, position: Int, carouselItem: CarouselItem?)

Callback method to be invoked when the RecyclerView has been scrolled. This will be called after the scroll has completed.

This callback will also be called if visible item range changes after a layout calculation. In that case, dx and dy will be 0.

Parameters

recyclerView

The RecyclerView which scrolled.

dx

The amount of horizontal scroll.

dy

The amount of vertical scroll.

position

Current item position. Check for RecyclerView.NO_POSITION.

carouselItem

Current item. It can be null.