Keep onPostScroll under detekt ReturnCount limit #71
@@ -205,10 +205,13 @@ private fun rememberDragDismissConnection(
|
|||||||
): Offset {
|
): Offset {
|
||||||
// After dismissal, eat all remaining drag so the
|
// After dismissal, eat all remaining drag so the
|
||||||
// scrollable doesn't paint over-scroll deltas during the
|
// scrollable doesn't paint over-scroll deltas during the
|
||||||
// pop transition.
|
// pop transition. Source guard folded into the `else if`
|
||||||
|
// chain so the function stays under detekt's ReturnCount
|
||||||
|
// ceiling of 2.
|
||||||
if (dismissed) return available
|
if (dismissed) return available
|
||||||
if (source != NestedScrollSource.UserInput) return Offset.Zero
|
return if (source != NestedScrollSource.UserInput) {
|
||||||
return if (available.y > 0f) {
|
Offset.Zero
|
||||||
|
} else if (available.y > 0f) {
|
||||||
accumulated += available.y
|
accumulated += available.y
|
||||||
if (accumulated >= thresholdPx) {
|
if (accumulated >= thresholdPx) {
|
||||||
dismissed = true
|
dismissed = true
|
||||||
|
|||||||
Reference in New Issue
Block a user