-
Notifications
You must be signed in to change notification settings - Fork 29.8k
PageView scroll physics to match Android #95423
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
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.
(see discussion in the issue)
Piinks
left a comment
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.
Hey @nt4f04uNd, happy new year! 🎉
You work on these various overlay apps are really great, thank you! I appreciate your care and attention to fidelity.
I see there are still some outstanding questions for @Hixie in the issue. Another thought though, if this is the default on Android, what about other platforms? Should this add a platform check and maintain the original behavior for platforms that are not Android?
|
Happy new year too!
I think not, because PageView is only a thing in Android world (if I'm not mistaken), and new behavior is better for usability, because it makes the animation more responsive to user's gestures. |
|
PageView surely applies on any number of platforms. It's just a ListView that snaps by item. |
Oh ok. So I spent some time and built an iOS implementation for the tabs_overlay. I unfortunately don't have a real iOS device on my hands at the moment, but as far as I can tell from running it in debug mode - the old implementation is not accurate with native iOS either. It seems that their implementation is similar to Android's - the faster you drag, there's noticably less duration, and no settling at the end. It seems that it would be fine to not add the platform check at the moment, and file a new issue for tuning it for iOS. Video (with the spring implementation in Flutter)video.mp4Video (with the new implementation in Flutter)video2.mp4 |
|
self-ping to put this at the top of my inbox for review tomorrow :) |
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.
Docs in tests! I love it!
Piinks
left a comment
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.
This LGTM, thank you for writing the overlay app for iOS too. It will definitely come in handy! Have you filed an issue for following up on that? You certainly do not need to fix it, but it would be good to have a tracking issue for it.
|
Filed #97064 for iOS |
|
Hey @nt4f04uNd I am going to revert this, there were some internal customers broken by this change. Can you re-open this as a new PR and we can discuss re-landing it there? Thanks! |
…utter#97150) This reverts commit daef082.
Fixes #38357
Compared with tabs_overlay app
The main problem with the current PageScrollPhysics is that they are ScrollSpringSimulation based, while Android implementation defines the exact duration the page view must move. This makes that both small and large fling simulations settle at the end, occupying unnecessary duration, during which user can't really interact with UI.
This PR copies the Android logic and makes it default.
Further discussion is in the issue #38357
Video before PR
before.mp4
Video after PR
after.mp4
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.