Bug 32928 - Taps are erratic on android
Summary: Taps are erratic on android
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.4
Hardware: PC Mac OS
: Highest blocker
Target Milestone: ---
Assignee: Rui Marinho
URL:
Depends on:
Blocks:
 
Reported: 2015-08-10 16:16 UTC by George Cook
Modified: 2015-10-05 06:50 UTC (History)
19 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:
VERIFIED FIXED

Description George Cook 2015-08-10 16:16:13 UTC
On all devices and emulators I get an issue now whereby tap gestures do not behave properly. Sometimes I have to tap 3 or 4 times before a tap is registered.

I wrote my own gesture recognizer library, and just swapped out to use that to work aroudn it. Most people won't have that luxury, so you guys should probably look into this. It does it for all taps, in all views.
Comment 1 David Ferguson 2015-08-10 22:21:20 UTC
I'm experiencing this significantly on a Nexus 6 with only a few apps installed on it (it is only used for testing and just got it this past weekend).  It seems to work much better in the simulators for me.  I do see it occasionally, though, and I chalked it up to the window not having the proper focus.
Comment 2 tim.ahrentlov 2015-08-11 04:37:06 UTC
I'm seeing the same thing on tap's which exhibits sluggish behaviour on Sony Z3, Samung S5, etc. You need to tap 2 or more times for the event to be registered.
Comment 3 Paul DiPietro [MSFT] 2015-08-11 16:44:24 UTC
Given the information provided here, we are not able to reproduce what is described. Providing a sample project that displays the occurrence of this problem as described would help in the investigation of this issue.
Comment 4 Arpit Jha 2015-08-12 06:04:36 UTC
I have checked this issue with Xamarin.Forms version 1.4.4.6392 and sample (http://developer.xamarin.com/samples/xamarin-forms/WorkingWithGestures/) and unable to reproduce this issue with the help of bug description.

Could you please provide us the Xamarin.Forms version on which you are facing this issue.

Screencast: http://www.screencast.com/t/2QQg1oyA2OYy

Environment Info:
=== Xamarin Studio ===

Version 5.9.5 (build 9)
Installation UUID: 3d25a767-a003-4a7d-9f5e-e57987cf6cf0
Runtime:
	Mono 4.0.3 ((detached/d6946b4)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400030020

=== Xamarin.Android ===

Version: 5.1.5.3 (Business Edition)
Android SDK: /Users/mac360_xamarin/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.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
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: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 6.3 (7569)
Build 6D570

=== Xamarin.iOS ===

Version: 8.10.4.49 (Business Edition)
Hash: 7e598ef
Branch: master
Build date: 2015-08-08 12:28:27-0400

=== Xamarin.Mac ===

Version: 2.3.0.89 (Business Edition)

=== Build Information ===

Release ID: 509050009
Git revision: b99cb19a1d3b15d8980c4616f13f837457e5b292
Build date: 2015-07-28 02:01:44-04
Xamarin addins: d53d6eceb828422f3d4aff8547f2f6bab6c9ea58

=== Operating System ===

Mac OS X 10.10.4
Darwin mac360-xamarins-Mac-mini.local 14.4.0 Darwin Kernel Version 14.4.0
    Thu May 28 11:35:04 PDT 2015
    root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64
Comment 5 Philipp 2015-08-12 09:06:14 UTC
I'm seeing the same thing since we upgraded to 1.4.4
Comment 6 Philipp 2015-08-12 09:56:53 UTC
@Arpit Jha: It works most of the time in the simulator. I could reproduce the sluggish behaviour with the WorkingWithGestures sample project on a Sony Z3.
Comment 7 David Ferguson 2015-08-12 10:23:16 UTC
I cannot upload a sample project at this time, but if I have a moment this weekend, I can try and create one.  I agree with Philipp, I'm only really seeing this on the device itself.

My app is straightforward, I have a master detail page with a custom hamburger image on the detail page (upper left corner).  The image click is used to display the drawer (master view) of the master detail.  The tap gesture is set up in xaml by adding a TapGestureRecognizer to the GestureRecognizers collection of the image.

Another area in the app where it seems to have problems is some labels that are set up with a navigation on tap.  Again, the tap gesture is set up in xaml like the hamburger image.

I believe the image and labels are on top of the z-order of controls (I don't think there is an invisible control over them).
Comment 8 Chris King 2015-08-12 11:46:11 UTC
We made a change to support double taps whereby we swapped out a simple android callback for a single tap event and replaced it with logic to listen for touch events and hand them over to a recognizer (also provided by android) to see if the touches represent a single tap or double tap. 

In the case were the developer registered handlers for both we have to wait a bit after the first touch to see if there is second. However we put in an optimization such that if there is no double tap handler we don't wait. 

So it's possible that optimization is broken or that simply going through the recognizer is slow on some devices. On the devices we tested against the single tap event registered immediately if not double tap handler was registered. We'll expand our pool of devices. 

Please continue to upload repro cases as that will also aid in our investigation and regression suite. 

Warm regards,
XFT
Comment 9 George Cook 2015-08-12 11:56:33 UTC
don't want to sound like a dick here, Chris; but I spent a month writing cross platform gestures for both android and iOS, and they work beautifully, with cancelling and should begin delegates, using your own mechanism - No subviews, no subclasses. All compositional. 

The blog post is here - at least take a look at the brief youtube video, as you'll see I have pans, swipes, taps (with any number of taps). It all uses IGestureRecognizer, and the Elements GestureRecognizers collection.


http://blog.twintechs.com/cross-platform-compositional-gesture-advanced-xamarin-forms-techniques-for-flexible-and-performant-cross-platform-apps-part-4

I have no such problem as you guys have (we've swapped over to my tap gesture recognizers since finding this new issue in 1.4.4) :  perhaps you guys can get some inspiration from what I've done.

Kind regards,

George.
ps

I hope you guys are going to give us added/removed callback hooks into IGestureRecognizer. I currently need to use an extra method to process them, if you further developed that interface I could offer my gestures to xamarin users, totally unobtrusively.
Comment 10 tim.ahrentlov 2015-08-18 10:28:20 UTC
Can we get a status this? This is not some esoteric hard to verify bug.
Comment 11 XamD 2015-08-19 03:18:58 UTC
We are facing same issue. Our application is ready to submit on google and iOS store but this is issue is show stopper for us. Please fix it asap.
Comment 12 XamD 2015-08-19 03:20:25 UTC
Please try to produce it on small tapping frame/ area. This is very annoying bug.
Comment 13 srinivas 2015-08-19 04:53:32 UTC
I am also facing same issue after updating xamarin.form.1.4.4 for android
Comment 14 srinivas 2015-08-19 07:48:38 UTC
any updates on this issue?
Comment 15 George Cook 2015-08-19 09:03:19 UTC
Have any of you tried using my cross platform gestures? The blog post I linked to, links to the open source project.

You could just copy out the gesture classes, as you need.

https://github.com/twintechs/TwinTechsFormsLib

We used this to get around the problem right now. It's practically a drop-in replacement (the callback method signature is slightly different); but other than that, you should be good to go.

If you're blocked, and tired of the complete silence here while, then you might as well give it a shot as a short term solution.
Comment 16 Michiel van Vlaardingen 2015-08-19 13:37:13 UTC
I'm experiencing something that seems related:   Tapping on android (5.0.2 on Samsung S5) is erratic when using my thumb for touching.   It does not happen if I tap very carefully with the tip of my index finger.

It seems almost like in 1.4.4 the gesture recogniser became stricter in what is a tap and what isn't.   either the max. distance between touchstart and touchend changed  or something related to how it determines if a view is hit or miss.
Comment 17 George Cook 2015-08-19 14:04:13 UTC
Its clearly a regression form the double tap behaviour. I think Your spot on Michiel. I do something similar for my double tap : that's the most useful feedback yet! (except for me pointing anyone truly stuck to source code they can use to get unstuck :p )
Comment 18 Mike 2015-08-19 23:46:38 UTC
This is also an issue for me, I find you need to test it on a real device, my device is a Galaxy S5 device.
Comment 19 Nick Tindall 2015-08-20 01:44:33 UTC
This is a problem for us too, the problem seems worst on Android devices with high res (xhdpi id borderline unusable, on SM-T700).

We would love a fix for this ASAP, will try George's library in the meantime, but this is not something we should require a third party library for.
Comment 20 Nick Tindall 2015-08-20 01:46:34 UTC
We're on 1.4.4.6392
Comment 21 Nick Tindall 2015-08-20 02:21:32 UTC
The bug is reproducible with the Working With Gestures sample, I think it's something to do with taps being registered as swipes or something, which is exacerbated on high-res screens because a slight slip of the fingers moves a substantial amount of pixels. Other native apps don't have this problem.
Comment 22 Nick Tindall 2015-08-20 02:22:41 UTC
(Reproduced on the Samsung SM-T700 using the Working With Gestures sample)
Comment 23 Jason Smith [MSFT] 2015-08-20 14:08:14 UTC
We are looking into this. Currently we believe this is an issue with the single vs double tap support interfering with each other.
Comment 24 Rui Marinho 2015-08-21 13:02:35 UTC
Marking as confirmed and in progress.
Comment 25 Rui Marinho 2015-08-25 07:31:11 UTC
Should be fixed in 1.5.0-pre3
Comment 26 Parmendra Kumar 2015-08-31 14:21:34 UTC
I have checked this issue with device MotoG (5.1.1) and I am not able to reproduce this issue with Xamrin.forms version 1.5.0-pre3.


Hence closing this issue.

If you getting same issue, please feel free to reopen this issue.


Thanks.


Environment info:

Xamarin.Forms: 1.5.0.6404-pre3
Xamarin Studio  5.9.6 (build 22)
Installation UUID: 1a096c6f-0678-402e-89b2-a2c10f7e80e4
Mono 4.0.4 ((detached/5ab4c0d)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400040001
Xamarin.Android : 5.1.6.5 (Enterprise Edition)
Xcode 6.1.1 (6611)
Xamarin.iOS: 8.10.5.26 (Enterprise Edition)
Mac OS X 10.9.4