-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Draft: Improve Refresh-Container usability #17496
base: master
Are you sure you want to change the base?
Draft: Improve Refresh-Container usability #17496
Conversation
You can test this PR using the following package version. |
Pushed a fix for number 2. |
It would be better to merge your gesture recognizer with the existing Pull recognizer. As long as the API is maintained, it should be fine. |
You can test this PR using the following package version. |
Thank you for the commit. Unfortunately it didn't completely fix the offset-issue, especially when using The problem arose because the offsets of the |
You can test this PR using the following package version. |
I looked into it but I didn't find a way to do this. The problem is that |
There are some other points I found while I was trying to improve the usability of the refresh behavior:
While this current implementation works, it is still far from perfect and does not feel that smooth like an native Android-Control. I don't know how much time I can pull into this issue, without any help. |
I don't quite understand the first point. If you have a list and are at the top of it, i.e. Offset = 0, pulling down will trigger the refresh. If you are not at the top, like Offset =0, pulling down will trigger scrolling with -delta Y, requiring you to release when at the top and then pulling down to trigger refresh. I think to some that behavior is preferable. But, yeah, it's not possible to transition from scrolling to pulling. The behavior in the second point was ported directly from WinUI. It's still open for improvement, especially making it work well with binding. Thanks for looking into this. |
Thank you for your quick answer. I was to vague on my first point so I have an example. I added some logs and the important part is that when you scroll "fast" (or just not slow enough) the first initial pointer event
If I now call Edit: |
There's an issue with cancelled pulls. The scrollviewer's visual offset doesn't reset when you do not pull fully, even though the refresh visualizer resets. |
We could allow other gestures to run if an active gesture is in a state where it can't process any more input, by suspending it and notifying all gestures that the pointer can be captured. |
…er not capturing unused points
Okay I honestly didn't think about it. Im passing the I also fixed the glitch where when you cancle the pull, it does not reset the Offset of the ScrollViewer. |
It will be best to keep the new recognizer as a separate gesture recognizer. It just needs a better name. |
Important: this is a first draft to get more feedback and discuss some behavior that is expected to happen.
The behaviour of the RefreshContainer is unintuitive for mobile users. This was picket up by this issue: #15529.
What does the pull request do?
This improved the drag-to-refresh behavior especially for mobile users and allows for a smoother experience. You are now able to start the refresh independent on the clicked position. For TopToBottom pulls it is only required that you scrolled to the top.
What is the current behavior?
#15529 goes into great detail but tldr:
This is especially noticable when you have configured the PullDirection to be anything than TopToBottom
What is the updated/expected behavior with this PR?
You are now able to trigger a refresh independen on the position you clicked, as long as you didnt scroll down (or up when the scroll behavior is BottomToTop). Left and Right scroll can be triggerd at any time right now (because it is a List that goes from top to bottom but I didnt think about Lists or things that go from left to right).
I show the desktop version here because I could easily capture the output. On mobile the experience is a lot smoother:
I was not able to fix the weard scroll-behavior but I will still try to find the bug.
How was the solution implemented (if it's not obvious)?
I created a new implementation of the
GestureRecognizer
where I moved more logic into thetouch-moved
event to allow for a smoother scroll and refresh behavior. Just fixing thecanPull
condition describet in the issue was not possible because it would hinder the scroll-down and making the refresh more 'reactive' is only possible in thetouch-moved
event.Checklist
Breaking changes
Discussion
There are some points I want to discuss first befor I cleaned up the implementation:
Fixed issues
Fixes #15529