-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Reland "PageView scroll physics to match Android #95423" #97166
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
|
@Piinks is the removal of dependency on |
|
Thanks for re-opening! Maybe that was it, what I saw in the customer tests were golden file images. They were capturing pictures of the screen after swiping through pages, but instead of being on the last page as expected, they were on the first page. |
|
Thanks for the details, it might be the case that this is because of the change of |
|
Customer A Test code to swipe to next page: await fling(customerApp, Offset(-200, 0), 200);I do not know if it makes a difference, but the screen ratio of this test is like a phone in landscape mode, longer across than from top to bottom. Customer B Same issue, swipes did not end up on the expected page index. Screen size is similar to portrait oriented phone. Swipe gesture from test: await tester.fling(
customerWidget,
Offset(-200, 0),
200,
);I think the way to proceed here is to add a temporary opt-in flag. I cannot change the customer tests ahead of time, because the behavior would not be right without this change. What we usually do here is
I think the ScrollBehavior might be the easiest way to do it, that way I can just opt the whole customer's app in pretty easily, and update the tests, but I'd like to know what you think about all this. Let me know and we can find a way for this to move forward. :) |
|
(I do not forget about this and my other PRs, it's just that I don't have much time for open source now, anyway I'll try my best to move this forward) |
|
Hey @nt4f04uNd, no worries at all. I really appreciate all of your contributions, they are often non-trivial solutions and very valuable to everyone - so thanks! Either way we'll still be here ready to work together when you come back. 😉 |
| return targetPage - page; | ||
| } | ||
|
|
||
| double _getTargetPixels(ScrollMetrics position, Tolerance tolerance, double velocity) { |
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.
@Piinks I just thought whether would it make sense to make some of these methods public, so people can restore the old implementation if they want (or just change it to whatever 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.
I don't know if that would be super beneficial, ultimately the changes you are introducing are the way it should be, there are just a lot of tests out there that expect the old behavior.
Thanks, I'd appreciate if you taken this part. |
Just confirming, I am going to close this PR and clone it to re-open another one that I can manage landing with affected customers? |
|
Yeah, sure 🙂 |
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 you recently reached out and asked if this was still on my radar. It is, although I have not had the cycles to work on it actively. There are some related issues that need resolution before we can re-land this, as noted in the comments of the test you wrote below.
I also think this should be only applied when the TargetPlatform is Android. The changes here are specific to Android and as you previously established (#97064), platforms like iOS have their own unique behavior. Especially since this broke customer tests, I think it would be prudent to only apply the change to the platform it is intended to reflect. Applying it to every platform would break more customers - who may be broken again later when we adjust the behavior for other platforms, creating a lot of churn for users.
| // Changing velocity for time 0 may cause a sudden, unwanted damping/speedup effect | ||
| expect(bounce.createBallisticSimulation(position, 1000)!.dx(0), moreOrLessEquals(1000)); | ||
| expect(clamp.createBallisticSimulation(position, 1000)!.dx(0), moreOrLessEquals(1000)); | ||
| expect(page.createBallisticSimulation(position, 1000)!.dx(0), moreOrLessEquals(1000)); |
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 being removed and the comments below it seem like the other issue should really be resolved first.
|
Cross-referencing #11599 to maintain link for next planning session. |
Fixes #38357
Reland #95423
Which was reverted to be treated as breaking change here #97150
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.