maui
maui copied to clipboard
[Android] Scrolls conflicts with nested ScrollView(s) (CarouselView, CollectionView, ListView)
Description
We are not able to scroll a CollectionView that is nested inside a parent scrollView (CollectionView) on same direction. It's also affect CarouselView, ListView etc... ( did not test with MapView, but same stuff)
The parent scrollView intercept the scroll rather than dispatch to child, it should not.
Expected behavior
The deepest child should be able to intercept the touch and parents should ignore it. Even if the deepest view reaches its scroll limit in used direction only, parents should ignore it to prevent conflicts. On iOS this behavior is native, but need to be well implemented on Android part.
Order requirement:
- We should allow only one scrollView to scroll at a time.
- We need to detect the direction. |↔| | ↕ |
- Dispatch the touch event to the deepest child that allow/enable scroll on this direction
- Prevent all parents to scroll during this event.
Steps to Reproduce
- Create an Horizontal CarouselView (3 views) |↔|
- Incorpore on each view a Vertical CollectionView. | ↕ |
- On the header of those vertical collectionView, add a Header with an Horizontal CollectionView |↔|
- Try to scroll the header, you can not because it's the same direction as the carouselView.
NB: When touching the header, it should prevent parents from scrolling horizontally |↔|, but leave it possible to scroll the closer parent vertically | ↕ |
Link to public reproduction project repository
https://github.com/Phenek/ScrollConflicts.git
Version with bug
6.0.486 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 11
Did you find any workaround?
No response
Relevant log output
No response
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.
Related to this Xamarin.forms issue
[Bug Android] Scrolls conflicts with ScrollView(s) (CarouselView, CollectionView, ListView) #9315
Many Android layouts could not be done with this issue. Touch events should be the same behavior as default iOS. Touch event must be consume by the deepest children, first.
All cross platform languages had this issue on Android a long time ago, they all get ride of it. It is crucial for our development process to achieve parity in layout capabilities, ensuring that we can replicate similar touch designs and touch functionalities with .Net MAUI
We currently try to migrate a custom Slider control based on Skiasharp (SkCanvasView). Touch events are swallowed by the ScrollView as soon as "Move" events start. It used to worked even on Xamarin with a custom ViewRenderer on Android!
Are there any workarounds for that issue on Android?
Having the same issue if I place Map inside CarouselView. On iOS touch is intercepted by map and I am able to move map around and change view in carousel. On Android as soon as I start horizontal movement the carousel takes the gesture and map can not be moved
I also had the same problem with the swiping mechanism in the CarouselView: https://github.com/dotnet/maui/issues/22507