Bug 59726 - Android Pinch Gesture comes in middle of Pan Gesture
Summary: Android Pinch Gesture comes in middle of Pan Gesture
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.4
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-09-25 15:26 UTC by RogerH
Modified: 2017-12-04 16:56 UTC (History)
2 users (show)

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

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:

Description RogerH 2017-09-25 15:26:45 UTC
Bug Report
I have an application that listens for Pan Gestures and for Pinch Gestures.

On iOS each gesture has a logical structure
You get a Pan.Starting event then lost of Pan.Running events and finally a Pan.Completed event.
a Pinch.Starting, lots of Pinch.Running events and then a Pinch.Completed event.

On Android things are different and you can be in the middle of some Pan events when Pinch Events start to appear.
When you do a pinch on Android, the first finger down is detected as a Pan (with a very tiny movement) and Pan.Starting
and a Pan.Running event is fired.

The second finger then triggers the Pinch Gesture sequence of events (Starting, Running, Completed)

As the pinch is released, Android returns to Panning and few more Pan events are fire before a Pan Complete.
So you end up with this chain of events on Android
  Pan.Start, Pan.Running and then 'Pinch.Start, Pinch.Running, Pinch.Completed' followed by more Pan.Running and Pan.Completed

My Workaround
I set a flag in Pan.Started (and clear in Pan.Completed).
If I get a Pinch and my flag is true (so Pinching while inside a Pan Gesture) I set a 2nd flag that helps me to ignore the Pans that come after the Pinch.

Suggested Fix
It would be nice for iOS and Android to be consistent where you either have a Pan sequence (start, running, completed) or a Pinch sequence (started, running, completed) but you don't have one inside the other.
Comment 1 Paul DiPietro [MSFT] 2017-10-02 16:45:30 UTC
Could you upload a reproduction to best illustrate this behavior?
Comment 2 Paul DiPietro [MSFT] 2017-12-04 16:56:44 UTC
This issue will be closed as no reproduction has been provided nor have any further comments been made. Please reopen this with a reproduction project if the issue still occurs as of the latest 2.5.0 stable release of Forms.

Guidelines for creating reproductions are available at: