-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Android] Receives the scrolled notification after some delay in horizontal scrolling #5187
Comments
Maybe related to or even duplicate of #5090 |
Hi @jfversluis, Thanks for your rapid response, As you mentioned, the horizontal scrolling is also not working. But, we achieved this through the workaround (Get the HorizontalScrollView's instance and invoke its scrollChange event and pass it to the virtual view's offset). Now, the horizontal scrolling is working on our side through the workaround. public partial class CustomScrollViewHandler : Microsoft.Maui.Handlers.ScrollViewHandler
{
private HorizontalScrollView nativeHorizontalScrollView;
protected override MauiScrollView CreateNativeView()
{
var nativeScrollView = base.CreateNativeView();
nativeScrollView.ChildViewAdded += this.MauiScrollView_ChildViewAdded;
return nativeScrollView;
}
private void MauiScrollView_ChildViewAdded(object? sender, ViewGroup.ChildViewAddedEventArgs e)
{
if (e.Child is HorizontalScrollView && e.Child != this.nativeHorizontalScrollView)
{
this.nativeHorizontalScrollView = (HorizontalScrollView)e.Child;
this.nativeHorizontalScrollView.ScrollChange += this.HorizontalScrollView_ScrollChange;
}
}
private void HorizontalScrollView_ScrollChange(object? sender, ScrollChangeEventArgs e)
{
this.VirtualView.HorizontalOffset = Microsoft.Maui.Platform.ContextExtensions.FromPixels(this.Context, e.ScrollX);
}
} In our case, the delay has happened in layouting a label while doing a fling in the scroll view. I guess the issue will be resolved if both scroll view's content scrolling and the Regards, |
Verified repro with Version 17.2.0 Preview 2.0 [32208.484.main] on Android 11 |
Hi, Any further update on this? |
@ashok-kuvaraja not yet, we'll get to it! |
Hi Team, Any further update on this? |
If there is you will see it here. Not need to ask :) |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Hi @ashok-kuvaraja. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version. You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Verified this issue with Visual Studio Enterprise 17.6.0 Preview 5.0. Not repro on Android Platform. |
Description
I have prepared a simple sample and written a custom grid to arrange a label based on the scroll view's
ScrollX
position. I have written a custom scroll view handler to achieve horizontal scrolling since the scrolled event did not work for horizontal orientation. The label is rendered to the screen after some delay when I fling a scroll view. But, If I do smooth scrolling, it layout properly.Seems the scroll view is moved based on the user scrolling interactions but the scroll views scrolled event is triggered after some delay from that. I guess this is the reason for happening the delay. So, When I fling a scroll view, the label is layout to the corresponding position after showing a blank screen little time.
Due to this issue, I am facing a layouting issue in the virtualization concept in my application. Please review and fix the bug or gimme any workaround to resolve this issue.
Steps to Reproduce
Sample:
ScrollingDemo.zip
Demo
XRecorder_10032022_060730.1.mp4
Version with bug
Preview 12
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Ensured in Android 7.1.1
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: