Bug 57515 - PinchGestureRecognizer not getting called on Android
Summary: PinchGestureRecognizer not getting called on Android
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.5
Hardware: PC Windows
: High critical
Target Milestone: 2.4.0
Assignee: Rui Marinho
URL:
Depends on:
Blocks:
 
Reported: 2017-06-15 08:20 UTC by Gordon Brown
Modified: 2017-09-18 14:40 UTC (History)
8 users (show)

Tags: ac android pinchgesture gesturerecognizer
Is this bug a regression?: Yes
Last known good build: 2.3.4.267


Attachments
repro project (1.98 MB, application/x-zip-compressed)
2017-08-18 16:47 UTC, Jimmy [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Gordon Brown 2017-06-15 08:20:12 UTC
The PinchGestureRecognizer is not being called when running on Android in a MasterDetailPage environment.

To reproduce, take the Hanselman.Forms sample and add the basics from the PinchGesture sample as a page from the Hanselman menu. A project that demonstrates this issue is available at https://1drv.ms/f/s!AmeCKE6dgpGln8Zy0avc8Vh94OOe2Q 

The picture is displayed but not zoomable.

It functions correctly on UWP desktop but the gesture code is not being called on Android on a Google Pixel device running 7.1.

This is based on the latest pre3 build.


Other notables.  
The PinchGesture sample functions correctly as a standalone app.
I believe the issue also affects the iOS build but was only able to test it on a simulator. 
Adding a TapGesture to the container (in addition to the PinchGesture) results in the TapGesture code being invoked.
Comment 1 Jimmy [MSFT] 2017-06-20 18:40:13 UTC
I was able to reproduce the issue using the attached project. As mentioned, this seems to only be affecting Android.

This appears to _not_ be specific to using a MasterDetailPage. I removed the MasterDetailPage from the sample and still saw the issue. I also ran the PinchGesture sample from our site[1] and experienced the issue after updating it to the 2.3.5 pre-release. So this looks like a regression between 2.3.4 and 2.3.5.


### Version Tests
2.3.6.111-nightly   BAD
2.3.5-pre3          BAD
2.3.5-pre1          BAD
2.3.4.247           GOOD

[1] https://developer.xamarin.com/samples/xamarin-forms/WorkingWithGestures/PinchGesture/
Comment 2 Jimmy [MSFT] 2017-08-18 16:47:03 UTC
Created attachment 24309 [details]
repro project

This issue is still happening with 2.4.0-pre1.


### Platforms Affected
Android


### Steps to Reproduce
1. Run the attached Android project
2. Do a pinch gesture on the image


### Expected Results
The image will be zoomed in.


### Actual Results
The image does not zoom.


### Possible Workaround
Use a Frame for the zoom container instead or add the PinchGestureRecognizer directly to the image. The issue seems to occur when the container is a ContentView or a layout (StackLayout, Grid, etc).


### Version Tests
2.4.0-pre1  BAD
2.3.5-pre6  BAD
2.3.4.267   GOOD
Comment 4 Samantha Houts [MSFT] 2017-09-11 23:07:44 UTC
https://github.com/xamarin/Xamarin.Forms/pull/1135
Comment 5 Nicholas Bauer 2017-09-17 13:36:56 UTC
May be relevant - I had a problem getting the pinch gesture to work on the emulator, but it did work on a physical device (API level 23).