-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Upward scroll fling value not consumed when refresh callback is called #16
Fix: Upward scroll fling value not consumed when refresh callback is called #16
Conversation
… called Consuming the fling value when the refresh starts since it holds no significant meaning in this context. #15
@wingio, Could you help me check whether this is acceptable? |
yeah i could do that tomorrow, and im sorry for not getting to it for so long, i wasn't aware this was opened |
For your information, I can revert the code for the sample module. I just wanted to show you the case which is #15 issue. |
No problem! Thank you! |
LGTM |
…called (#16) (#17) * Fix the wrong compiler version for the demo project. * [#15] Upward scroll fling value not consumed when refresh callback Is called Consuming the fling value when the refresh starts since it holds no significant meaning in this context. #15 Co-authored-by: Lake <[email protected]>
.verticalScroll(rememberScrollState()), | ||
contentAlignment = Alignment.Center | ||
LazyColumn( | ||
Modifier.fillMaxSize(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use named arguments
Modifier.fillMaxSize(), | |
modifier = Modifier.fillMaxSize(), |
color = MaterialTheme.colorScheme.outline, | ||
shape = RoundedCornerShape(10.dp) | ||
) | ||
.padding(10.dp), text = "No. $it" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These shouldn't be on the same line
// If the velocity is negative, the fling is upwards, and we don't want to prevent the | ||
// the list from scrolling | ||
velocity < 0f -> 0f | ||
velocity < 0f -> if (isRefreshTiming) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A one-liner arrow for a multiline if seems weird, use blocks instead
velocity < 0f -> if (isRefreshTiming) { | |
velocity < 0f -> { | |
if (isRefreshTiming) { |
velocity < 0f -> if (isRefreshTiming) { | ||
// We need to prevent the fling upward when the refresh starts. | ||
velocity | ||
}else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace
}else { | |
} else { |
Oh crap I had this tab open like 6 hours ago, forgot to press "Request changes". @wingio could you review code style too next time? |
…ode to match with README.md (#19) * A one-liner arrow for a multiline if seems weird, using blocks instead * #16 (comment) * Add a whitespace * #16 (comment) * Change back DragRefreshSample.kt code to match with README.md
This PR is my revision of #15.
I would appreciate feedback from the maintainers.