Bug 38655 - [Forms][Android] Discrepancy between behaviour of TapGestureRecognizer and PanGestureRecognizer when compared with iOS
Summary: [Forms][Android] Discrepancy between behaviour of TapGestureRecognizer and Pa...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.0.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-02-10 23:19 UTC by Dominic N [MSFT]
Modified: 2016-07-01 12:30 UTC (History)
12 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Sample project for repro (296.94 KB, application/zip)
2016-02-10 23:19 UTC, Dominic N [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 Dominic N [MSFT] 2016-02-10 23:19:14 UTC
Created attachment 14993 [details]
Sample project for repro

### Overview

Using the following three gesture recognizers in a custom Content View:

- TapGestureRecognizer with a Tapped event hander
- PinchGestureRecognizer with a PinchUpdated event handler
- PanGestureRecognizer with a PanUpdated event handler

With Forms results in a discrepancy in behaviour between WinPhone 8.1 and iOS when compared with Android. The three event handlers work on iOS and WinPhone when used together, but the Tap and Pan event handlers do not work on Android. When the PinchGestureRecognizer is removed from the ContentView, the other two handlers work as expected on Android.


### Steps to reproduce

1. Download attached sample project
2. Run on iOS/WinPhone
3. Test pinch, tap, and pan event handlers by pinching, swiping to pan, and tapping
4. Run on Android
5. Repeat step 3


### Expected behavior

iOS, WinPhone, and Android behave the same and allow for the pinch, tap, and pan handlers to fire.


### Actual behavior

TapGestureRecognizer and PanGestureRecognizer do not work on Android


### Supplemental info

Tested on both the current release of Forms as well as the latest pre-release. Sample project is attached.


### Test environment

=== Xamarin Studio ===

Version 5.10.2 (build 56)
Installation UUID: ee07b9c8-41e3-496f-a1ab-e8a3ed3db20f
Runtime:
	Mono 4.2.2 (explicit/996df3c)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402020030

=== Xamarin.Profiler ===

Version: 0.22.0.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 6.0.1.10 (Business Edition)
Android SDK: /Users/dominic/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.1
SDK Build Tools Version: 23.0.0

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 7.2 (9536.2)
Build 7C46t

=== Xamarin.iOS ===

Version: 9.4.1.25 (Business Edition)
Hash: 962a050
Branch: master
Build date: 2016-01-29 16:59:11-0500

=== Xamarin.Mac ===

Version: 2.4.1.6 (Business Edition)

=== Build Information ===

Release ID: 510020056
Git revision: bb74ff467c62ded42b7b7ac7fdd2edc60f8647b0
Build date: 2016-01-26 16:24:41-05
Xamarin addins: 8b797d7ba24d5abab226c2cf9fda77f666263f1b
Build lane: monodevelop-lion-cycle6-c6sr1

=== Operating System ===

Mac OS X 10.10.5
Darwin Dominics-MacBook-Pro.local 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Comment 3 Davide Zordan 2016-02-27 16:23:09 UTC
I'm experiencing the same issue.

Thanks,
Davide
Comment 4 clovis1.nicolas 2016-03-11 09:36:51 UTC
I'm also experiencing this issue.
Comment 5 SookWei 2016-03-31 01:52:59 UTC
I'm also experiencing this issue when try to add gesture recognizer into my app.
Comment 6 Martin Krkoska 2016-04-11 14:12:48 UTC
I have same issues with gesture recognizers.
Comment 7 ssavaria 2016-05-25 15:17:27 UTC
I have the same issue.

If I put a Tap Gesture Recognizer on a stack layout, and disable and enable the stack layout, on android, the Gesture Recognizer does not fire the tap action anymore.

Thanks for looking into this issue,
Sam :)
Comment 8 Morten 2016-06-07 09:42:29 UTC
I have the same issue.

But I don't agree, that the three event handlers work as they should on iOS (WinPhone not tested) when used together.

A. I pinch-in, pans around and pinch-out, then the image ends up in the bottom right corner of the screen.
B. And sometimes if i tap-to-zoom, then 1/3 of the images left side is cut of and I can pan the image halfway out the screen to the left.
Comment 9 Rui Marinho 2016-06-08 10:48:10 UTC
This seems to be working with 2.3.0-pre3.
Comment 10 Morten 2016-06-10 07:59:14 UTC
Now I have also tested with 2.3.0.46-pre3 and I don't agree that it's fixed.

I tested with the attach example project and upgraded to the pre-release.
It works better now, but still not production ready.

A. I still experience that the image sometimes "jumps" while pinch-zooming in.
B. When you have pan-around the image and zooms all the way out, you can still experience that the image is stuck partly out of the screen.
C. When tap-zooming in the image os zoomed in, but is send down in the bottom of the screen. 
D. And sometimes if i tap-to-zoom, then 1/3 of the images left side is cut of and I can pan the image halfway out the screen to the left.

Please don't close this bug, before the issue is solved completely.
Comment 11 Rui Marinho 2016-06-10 15:05:12 UTC
Hi, the issue here were not working both at the same time if i understand correctly. 

The code to handle how the picture is manipulated is related to the user and not XF itself.
As far as i can tell all events for the gestures are firing when they are suppose too.

Please open a new bug with a reproduction case if some of the values coming from the events are wrong. 


thanks.

Warm Regards
Xamarin Forms Team
Comment 12 Saskia 2016-06-15 12:14:13 UTC
I would like to try the fix. But I cannot update to xamarin.forms 2.2 or higher.
I submitted an error for that problem: 41847.
Comment 13 Saskia 2016-07-01 12:30:25 UTC
I can now update to Xamarin.Forms 2.3.0.107, but that causes problems with nuget packages that are using older libraries (see 41847).

The statement 'Add amazing functionality to your app in minutes with Xamarin Components' is only true when you're Lucky enough (or your company big enough) to select the right components.