-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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: Pinch gesture not working properly in Carousel #18569
Comments
Having investigated this issue further I have found that the Pinch Zoom on Android using the above technique and as documented in Microsoft learn has the same issue with or without being contained in a Carousel view. |
Upon further investigation it does appear that the CarouselView on Android does block pinch gestures when IsSwipeEnabled is true. When false Pinch Gestures work as expected allowing pinch to zoom. |
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
Hey @BenBtg would you be able to share a bit of code with your workaround here? We are moving this one to the Backlog again for future consideration as we're working on improving our processes and transparency around planning work for servicing. |
Hi @unombun. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. 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. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate. |
@BenBtg |
Sorry for the delay. Just back from leave. The suggested workaround wasn't sufficient. The eventual approach taken was to navigate to a dedicated zoom page outside of the carousel. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate. |
This issue needs to remain open. Current proposed workaround is not sufficient. |
Progress here https://github.com/dotnet/maui/tree/fix-18569 |
The same sample running on Xamarin.Forms: Sometimes the pinch to zoom not works (for the same .NET MAUI issues, touch conflicts), but once works is working fine, panning works, etc. The behavior is better in Xamarin.Forms than in .NET MAUI. |
Does that mean this issue should be treated as a regression? |
Not in .NET MAUI itself, but is a different behavior from Xamarin.Forms. |
|
The issue with Pinch and PanUpdated (CarouselView) on Android still persists. |
Description
We want to have a carousel with images that can be zoomed. We want to swipe so the carousel to change the image, and with pinch and pan gesture we want to zoom in or out or move the zoomed image.
On Android if you have an ContentView with PinchGestureRecognizer added from the code, the pinch event is not triggered at all. In order to trigger the event you have to manually add the PinchGestureRecognizer from the XAML code directly to the Image you want to zoom and call your pinch event from the xaml.cs (as exemplified in the repro). Even though we managed to trigger the pinch event, the problem is that only on Android the event is not triggered correctly. The pinch values are sent chaotic and the image is zoomed very strange. Apart that the Pinch event can be triggered with just one finger which should not be possible.
This issue was found in .net7 we tested both on simulator and real device in debug and release mode.
We found out that if you set the PinchGestureRecognizer in the first Grid of the page, the event triggers correctly and smoothly, this should work in some cases where you have just one picture in the page but in our case we have a carousel-view with images and we want to zoom each image and block the scrolling while zooming.
In order to be able to trigger the events on the grid, the carousel-view needs to be set input transparent.
But the problem is if the carousel is transparent, we lose the functionality behind with the scrolling.
We tried different scenarios where we manually set the PinchGestureRecognizer directly to the carousell-view or the ZoomContentView but we encountered the same behaviour.
On iOS it works perfectly.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/flesarradu/AndroidPinchGestureIssue
Version with bug
7.0.96
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: