Open timunie opened 1 year ago
I think we need something similar to InteractionTracker from UWP/WinUI. Scrolling in the composition layer will be maximum smooth. Also, such scrolling will not be affected by possible microfreezings in the UI thread. And after that, it will be possible to rewrite ScrollViewer (ScrollContentPresenter) to this tracker. I don't think anyone really needs current "jumping" scroll...
I tried to implement something similar and it seems to be working, but had to use a tons of hacks.
@Meloman19 how beautiful is that 😍
Do you mind sharing your tons of hacks here for others? I'd be interested also in how you made it work.
@timunie Sorry for the delay.
Here test implementation: https://github.com/Meloman19/CompositionScroll Only scrolling with the mouse wheel and scroll bar works. There are some issues with virtualization and anchoring.
In general, the concept is working, but virtualization tied to EffectiveViewport causes a problem, because we need to call Arrange in each Offset changed.
@Meloman19 thank you so much. Appreciate it ❤️
@Meloman19
I can't describe how your work is amazing. Can I ask, maybe you have any ideas how it could work with touch input as well? What needs to be done there in order to work?
@dotNET-anykey their code should handle touch scroll gesture as well.
Although, Avalonia already supports smooth scrolling for touch for a long time. But we planned to implement composition-level scrolling for a while now too.
With the implementation from @Meloman19, I found an issue that having compositeScroll and Carousel in same userControl makes Carousel not reflect to updates of SelectedIndex.
With the implementation from @Meloman19, I found an issue that having compositeScroll and Carousel in same userControl makes Carousel not reflect to updates of SelectedIndex.
CompositeScroll not support ILogicalScrollable (DateTimePickerPanel and VirtualizingCarouselPanel). By design ILogicalScrollable handle own scrolling what conflict with Presenter's InteractionTracker.
Is your feature request related to a problem? Please describe. Until today scrolling cannot be animated very good which feels unnatural in some situations, for example having long text.
Describe the solution you'd like Provide an API to enable animated scrolling on user request
Describe alternatives you've considered Implement a Behavior or a custom ScrollViewer
Additional context First discussed here #12945