Comments (5)
The problem with gestures that you are experiencing on Android is due to a decision by the Google team responsible for mobile Chrome to use gestures for history navigation, etc. in their mobile browser. Because they are cooping all gestures, there is no way to capture gestures on Android with mobile Chrome. Gestures should work with the older native Android browser, as I have done extensive testing with that.
There is a way of enabling gestures on the Android browser, but it disables scrolling on all html elements. You can capture a touchMove event, but the browser never exposes the touchEnd for it. If you do Google search for gestures for mobile Chrome, you'll find lots of frustrated developers. Recently I spent a week trying to find some way to get gestures working with Android 4.4 Kitkat, but it was hopeless since it always resulted in not being able to scroll a page. If your use case is a single screen that doesn't require scrolling, a very limited scenario, then you could get gestures working.
Since both Apple and Microsoft have gestures AND scrolling working in the browsers, and Google had them working fine in their native Android browser, I don't know what to say.
That said, I'm always coming back to the gestures module to see if I can find some way of getting around Google's kidnapping of gesture events.
By the way, If you want to devel into the gestures module, feel free to. Log out values and what what happens. Maybe you might come up with a way to get around the lack of a touchEnd event for touchMove events.
from chocolatechip-ui.
That is strange because I've also tried the stock Android browser (not chrome) and swipe still didn't work, however for example opening this website on my android mobile (chrome), I can swipe right and left and also scroll up/down the page
http://stephband.info/jquery.event.swipe/ (image slider can be swiped)
Maybe if I can manage to replace gesture codes from CHUI with this plugin I can overcome the issue, I'll try anyway.
And thanks for putting so much time into this, really appreciated.
from chocolatechip-ui.
I check out the link. I did notice that his code does not work on Windows 8, 8.1 on touch screens or on the Surface due to lacking support for Microsoft pointer events. Easy to add that in though.
So, after analyzing his plugin, jQuery.event.move, which is the basis of his swipe implementation, I see he’s not even trying to trap the touchEnd event after moveStart. Instead he’s checking for touchesChanged, then grabbing the coordinates and checking with the coordinates from the touchStart. That’s a very short distance for tracking a gesture, maybe something like 5 pixels, whereas I was using 30 pixels to prevent false gesture detection.
I’ll need to go back and refactor the gestures module with that in mind. Unfortunately I’m really tied up with a lot of things for the next week, so I won’t have time to tackle this until after. Are you using jQuery with your build? If you are I’d suggest you use his plugin for now. (you need both jQuery.event.move and jQuery.event.swipe).
I’m thinking I’ll make this and Android specific fix in the code so that iOS and Windows remain as they are with touchEnd and pointEnd events.
Cheers
Robert
Product Director
ChocolateChip-UI
San Francisco
On Jan 9, 2014, at 8:00 PM, ez666 [email protected] wrote:
That is strange because I've also tried the stock Android browser (not chrome) and swipe still didn't work, however for example opening this website on my android mobile (chrome), I can swipe right and left and also scroll up/down the page
http://stephband.info/jquery.event.swipe/ (image slider can be swiped)Maybe if I can manage to replace gesture codes from CHUI with this plugin I can overcome the issue, I'll try anyway.
And thanks for putting so much time into this, really appreciated.—
Reply to this email directly or view it on GitHub.
from chocolatechip-ui.
I ended up using a plug-in as you suggested however switched to TouchSwipe https://github.com/mattbryson/TouchSwipe-Jquery-Plugin
with this one by default it detects the swipe after 70px move which is better than previous plug-in (not sure about windows support though).
Cheers
from chocolatechip-ui.
Finally fixed the issue. I had to add in a check for Android, then capture the distance and direction during the touchMove phase instead of waiting for a touchEnd to occur. That means it's a rather short detection length for Android, just 10 pixels as compared to 30 pixels for everyone else. But it seems to be working, while still allow the user to scroll the page. Be aware the it takes a precise placement of the finger on the screen to detect a swipe. A very casual swipe may not be caught.
from chocolatechip-ui.
Related Issues (20)
- Example navigation-backto: scroll always results entering detail page HOT 2
- Grid do not work on Safari (iPad) HOT 2
- Chocolatechipjs in its own repo HOT 2
- Back button not rendering correctly on WP8 HOT 3
- Phonegap iOS scrolling singletap hadling issues HOT 23
- $.UIEditList callback function when an item is deleted HOT 6
- data-goto not functioning in Firefox 34, 35 HOT 7
- Chocolatechip-ui app freezes after iOS unlock HOT 2
- Keyboard autofocus being triggered on input fields
- data-goto syntax in docs is wrong HOT 1
- Where do I find example for buttons? HOT 2
- Cannot read property 'classList' of null HOT 4
- chui 3.5.5 does not work on Android Jellybean (4.2) HOT 12
- chocolatechip-ui.json purpose? HOT 3
- $.UIDeletable cannot read property 'on' of undefined HOT 13
- $.UIGoToArticle() loses history between tabs HOT 12
- wp8 nokia lumia 520 "back button issue" HOT 5
- Low Memory Warnings HOT 6
- Error when using $.UIGoToArticle HOT 9
- Tabbar on Android - with scrolled content double click needed HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chocolatechip-ui.