To add androidx recyclerview bindings, import corbind-recyclerview
module:
dependencies {
implementation("ru.ldralighieri.corbind:corbind-recyclerview:1.11.0")
}
List of extensions
Component | Extension | Description |
---|---|---|
RecyclerView.Adapter | dataChanges |
Called when the RecyclerView’s adapter data has been changed |
RecyclerView | childAttachStateChangeEvents |
Called when a view is attached to or detached from the RecyclerView. |
flingEvents |
Handle a fling given the velocities in both x and y directions | |
scrollEvents |
Called when a scrolling event has occurred on that RecyclerView. | |
scrollStateChanges |
Called when RecyclerView’s scroll state changes. |
Example
rv.scrollStateChanges() // Flow<Int>
.onEach { /* handle RecyclerView scroll state change events */ }
.flowWithLifecycle(lifecycle)
.launchIn(scope)
More examples in source code