cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject RE: Standardized gestures
Date Thu, 18 Apr 2013 17:08:40 GMT
On the short them, it would help solve 'Android fragmentation' problems:

Android doesn't exactly pass the touchstart etc.. events to webkit the same way and more importantly
with the same delays. Not to mention, some versions have bugs (missing touchend, touchmove
If coding a pure HTML/javascript app, you can avoid the 'native' onTouch() processing and
pass events faster to your app.  

It's an educated guess at the moment, but I'm quite sure performance / response time for the
user on all platforms will be better if the gesture detection is done on the native side.

On the long term, I don't see how JavaScript libraries would allow (within reasonable ms)
for more complex 'gesture' detection. I would rather do something like:
// do gesture detection in native code
   webView.sendJavascript("cordova.fireEvent('handgrab', {node, ...}");

-----Original Message-----
From: Filip Maj [] 
Sent: Wednesday, April 17, 2013 12:47 PM
Subject: Re: Standardized gestures

I'm not convinced you need any additional code here.

Touch events are already fired by the web view containers. You could build up gesture detection
in JavaScript by listening to these events.

There are libraries out there that do this for you already:

 - jquery ui plugin:
 - jquery plugin:
 - moar jquery:

On 4/17/13 9:42 AM, "" <> wrote:

>I'm experimenting with Cordova on Android, iOS and Windows 8.
>Has there been a discussion around trying to implement to set of 
>'standard' gesture recognizers:
>The idea would be that the native side executes JavaScript like:
>javascript:cordova.fireEvent('tap', {node: 
>document.elementFromPoint(400, 300), x: 400, y:300 }); 
>javascript:cordova.fireEvent('slide', {node:
>document.elementFromPoint(400, 300), x: 400, y:300});
>This function could use document.createEvent to initiate events on the 
>DOM node:
>The purpose of this would be to have a consistent set of gesture 
>recognition across different devices instead of having javascript code 
>in the 'WebView' trying to do gesture detection.

View raw message