scrollStateChanges

Create a Flow of scroll state change events on the RecyclerView instance where the value emitted can be one of SCROLL_STATE_IDLE, SCROLL_STATE_DRAGGING} or SCROLL_STATE_SETTLING.

Note: Created flow keeps a strong reference to the RecyclerView instance until the coroutine that launched the flow collector is cancelled.

Example of usage:

recyclerView.scrollStateChanges()
.onEach { state ->
// handle state
}
.launchIn(uiScope)