removing a useless comment + style cleanup
This commit is contained in:
parent
f423ea1bd7
commit
0035e6440c
1 changed files with 1 additions and 8 deletions
|
@ -2,16 +2,9 @@ package com.simplemobiletools.keyboard.extensions
|
|||
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
/**
|
||||
* Calls the [scroll] callback when the receiving RecyclerView's scroll position is changed.
|
||||
*/
|
||||
fun RecyclerView.onScroll(scroll: (Int) -> Unit) {
|
||||
addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||
override fun onScrolled(
|
||||
recyclerView: RecyclerView,
|
||||
dx: Int,
|
||||
dy: Int,
|
||||
) {
|
||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
super.onScrolled(recyclerView, dx, dy)
|
||||
scroll(computeVerticalScrollOffset())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue