Wilberforce Uwadiegwu
11/14/2024, 8:39 AMprivate class MyPagerNestedScrollConnection(val state: PagerState) : NestedScrollConnection {
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
return if (source == NestedScrollSource.UserInput && abs(state.currentPageOffsetFraction) > 1e-6) {
available.copy(y = 0f)
} else {
Offset.Zero
}
}
override fun onPostScroll(consumed: Offset, available: Offset, source: NestedScrollSource): Offset {
return available.copy(y = 0f)
}
override suspend fun onPostFling(consumed: Velocity, available: Velocity): Velocity {
return available.copy(y = 0f)
}
}
But it disables the overscroll animation effect on the LazyRows.