-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Reimplemented StretchingOverscrollIndicator with Simulation ported from Android 12. #173849
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
base: master
Are you sure you want to change the base?
Conversation
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.
Code Review
This pull request is a great improvement to the StretchingOverscrollIndicator, replacing the previous animation logic with a more physically realistic SpringSimulation. This results in a much more natural feel, especially for high-velocity flings, aligning it better with native Android behavior. The code is well-structured, and the addition of a regression test is appreciated.
I've found a critical issue related to animation controller lifecycle management that could lead to race conditions. I've also identified a couple of medium-severity issues related to code clarity and maintainability. Addressing these will make the implementation more robust and easier to understand.
Overall, this is a high-quality contribution.
|
Thank you for this amazing change! My first round of review focuses on the constants for the spring simulation. |
6bad613 to
5cf9c30
Compare
|
Thanks Tong! I am rebasing here since it looks like there is no Google testing instance currently. We need that to validate we have resolved any remaining failures before merging. |
Co-authored-by: Tong Mu <[email protected]>
Co-authored-by: Victor Sanni <[email protected]>
Co-authored-by: Victor Sanni <[email protected]>
Co-authored-by: Tong Mu <[email protected]>
Co-authored-by: Tong Mu <[email protected]>
0ccff30 to
7d737d5
Compare
|
Checking in here: there are many failing tests behind the Google testing check here. I am working through them to validate the changes are expected, for example screenshot tests that captured the overscroll state. |
Fixed an issue #169659
This PR improves the StretchingOverscrollIndicator to better match native Android behavior.
This change ensures that momentum-based gestures produce a more natural and intuitive overscroll experience, especially for users accustomed to native Android scroll views.
Fling
3.mp4
Pull And Reduce
Also, a very similar animation is implemented when pulling as well.
3.mp4
Pre-launch Checklist
///).