Overscroll any scrollable items!
Preview.for.overscroll.and.nested.invoke.mp4
The 1.4.0-beta02 version has a serious nested gesture dispatch error.You can find a failed test case in the test module.
Column(Modifier
.fillMaxSize()
.overScrollVertical() // invoke before the scrollable Modifier
//.overScrollHorizontal() // or this
.verticalScroll(state = scrollState, flingBehavior = rememberOverscrollFlingBehavior { scrollState }) // must use rememberOverscrollFlingBehavior
//.horizontalScroll(state = scrollState, flingBehavior = rememberOverscrollFlingBehavior { scrollState }) // must use rememberOverscrollFlingBehavior
) {
// ...
}
val scrollState = rememberLazyListState()
LazyColumn(Modifier
.fillMaxWidth()
.overScrollVertical(), // * u should do it
state = scrollState, // * u should do it
flingBehavior = rememberOverscrollFlingBehavior { scrollState } // * u should do it after compose 1.3.x because this's a added param.
) {
// ...
}
This is an issue submitted to Google about this project: https://issuetracker.google.com/issues/276682419 https://issuetracker.google.com/issues/261895103