Bug 40733 - PanGestureRecognizer Android event args TotalX Updating different values from iOS
Summary: PanGestureRecognizer Android event args TotalX Updating different values from...
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.1.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-04-27 13:56 UTC by James Prankard
Modified: 2018-02-04 21:09 UTC (History)
4 users (show)

Tags: ac
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:
Status:
RESOLVED ANSWERED

Description James Prankard 2016-04-27 13:56:41 UTC
You can find the source files here (or class below):
https://github.com/prankard/XamarinFormsPanGesture

Class in question:
https://github.com/prankard/XamarinFormsPanGesture/blob/master/Pages/PanPage.cs

This example of dragging a box and updating the values does not work on Android, but does work on iOS.
If you drag the box around on the X axis you get incorrect values from e.TotalX (pan gesture event) which in turn makes the box flicker when dragging.

Please note, this is a different bug from: 38655 which is a similar but different issue reported.

Thanks for reading.
Comment 1 Samantha Houts [MSFT] 2016-09-22 01:04:58 UTC
We actually recommend that you add a PanGestureRecognizer to a separate ContentView that contains the elements that you want to pan. Please see https://developer.xamarin.com/guides/xamarin-forms/user-interface/gestures/pan/ for an example.

We recommend this because Android is not happy when you access an element's positional values while it is being translated. It causes erratic values to be returned, as you see here in your example.