wzr1337 / angular-gestures

AngularJS directive that adds support for multi touch gestures to your app. Based on hammer.js.
MIT License
509 stars 100 forks source link

Not working in standard browser on andriod #5

Open Thorjan opened 10 years ago

Thorjan commented 10 years ago

The gestures don't seem to work on the standard browser of an andriod device.

I've tested it on a Android 4.1.2 and 4.0.3.

If I user the chrome browser on those android devices, it works fine, but not when I use the standard browser. Since most people still use the standard browser that is clearly an issue.

GreeTz Thor

louiswilbrink commented 10 years ago

Hi,

First, thank you for writing an angular module for the hammer library.

Here's what I've been seeing so far:

wzr1337 commented 10 years ago

Thanks for your Report,

I need to check the pinch on my android. Any other gestures you tried without success?

On Monday, October 21, 2013, Louis Wilbrink wrote:

Hi,

First, thank you for writing an angular module for the hammer library.

Here's what I've been seeing so far:

  • hmDrag is working, but not hmPinch. I've tested this using a Nexus 10, Android 4.3, Chrome 30.0.1.1599.82. Both work well on iPad 4 / iOS 7 / Chrome 30.0.1.1599.12.

— Reply to this email directly or view it on GitHubhttps://github.com/wzr1337/angular-gestures/issues/5#issuecomment-26739739 .

Register on http://zwoup.com for the next Generation Shopping List on your smartphone. You can also follow us on @zwoup at twitter and http://Facebook.com/pages/zwoup .

Thorjan commented 10 years ago

Hi,

I've been trying to use hm-Swipe which isn't working.

GreeTz

Thor

louiswilbrink commented 10 years ago

hm-Swipe triggers on Android / Chrome for me.

I'll keep the feedback coming as I bootstrap this into my current project.

louiswilbrink commented 10 years ago

Update: hm-Swipe triggers in Android / Chrome, but I get an undefined value when accessing event.gesture. (I'm trying to preventDefault on it)

louiswilbrink commented 10 years ago

hm-double-tap triggers on Android / Chrome, no errors thrown, but the preventDefault() function has no effect (still triggers a browser zoom). This also occurs on iPad 4 / iOS 7 / Chrome:

$scope.doubleTapped = function (event) { event.gestures.preventDefault(); };

wzr1337 commented 10 years ago

can you please post a fiddle?

Thorjan commented 10 years ago

Hi,

Here is a fiddle with swipe that does not work on standard android brower: http://jsfiddle.net/cREN2/5/

Thnx...

Thor

Thorjan commented 10 years ago

I miss clicked :-s... didn't mean to close the issue.

wzr1337 commented 10 years ago

Don't you get valid $log.log() output with this fiddle? http://jsfiddle.net/cREN2/7/

Thorjan commented 10 years ago

Nope,

On my android smartphone there is no console, but I changed the log to an alert(); and it didn't pop-up. It doesn't seem to trigger the 'OpenTekst' or 'OpenImage' functions. On other browsers it does.

GReetZ Thor

wzr1337 commented 10 years ago

Hammer JS demo site works for you, right?

I do not see any difference between a tap, hold or swipe in calling back, so I am wondering why some gestures work and others don't.

I need to digg deeper, but that will take a few days, sorry.

Thorjan commented 10 years ago

Yes, I can confirm that the hammer JS demo works on the standard browser of both my android devices

Thnx for investigating this issue.

GreeTz Thor

louiswilbrink commented 10 years ago

So the issues I'm seeing seems to be related to hammerjs on Chrome 30.

I made plnkr to test hammer here: http://embed.plnkr.co/OkFBsl5JGE3h7AqfQFCd/preview

Added an issue here: https://github.com/EightMedia/hammer.js/issues/388

r-cohen commented 10 years ago

I seem to have the same problem on some recent Android devices with recent version of Chrome. Here is result of my tests using Android 4.4.2 on a Nexus 5 with Chrome 32.

HammerJS demos http://eightmedia.github.io/hammer.js/examples/events.html http://eightmedia.github.io/hammer.js/examples/pull-to-refresh.html http://eightmedia.github.io/hammer.js/examples/carousel.html Result: All demos work fine. All swipe events get triggered.

angular-gestures demo app https://github.com/wzr1337/angular-gestures/tree/master/demo/app Result: No swipe events. Tap, drag, and hold do get logged correctly, but no swipe event. hm-swipe just doesn't get triggered.

r-cohen commented 10 years ago

Just a note: got swipe to work but you have to swipe like super fast so that it actually registers the swipe event. which isn't the case with Hammer. I saw that the sources of angular-gestures use Hammer version 1.0.5, so what I did is replace the Hammer part by version 1.0.6, but still no success, same result : have to swipe super fast on Android to make it register. Which is a bummer. Don't know if I should continue with angular-gestures or use ngTouch. I used the $swipe service before and was kind of disapointed. Oh well...

wzr1337 commented 10 years ago

have you tried to set

swipe_velocity: 0.7

to something lower, like 0.4 ?

webalchemist commented 10 years ago

I was having the same issue with the swipe needing to be very fast. Lowering swipe_velocity worked for me.

swipe_velocity: 0.2 seemed about right.

samaxes commented 9 years ago

hm-swipe-opts="{swipe_velocity: 0.2}" is not working for me, however changing the attribute to hm-swipe-right-opts="{swipe_velocity: 0.2}" does work.

My code looks like this:

<body hm-swipe-left="goTo($event)" hm-swipe-right="goTo($event)" hm-swipe-right-opts="{swipe_velocity: 0.2}">

Do you want me to fill a bug?

wzr1337 commented 9 years ago

can you guys please check if issue is still open after migrating to hammer 2.0 ?

archcra commented 9 years ago

Yes, there is still no swipe default on my emulator/phone/pad(all 4.x, but another phone-Android 2.3.7 does work), but use: swipe_velocity: 0.2 maybe work: now it works on emulator.

archcra commented 9 years ago

Still not work on phone/pad(4.x). Works on emulator but not very responsible. Only works on Android 2.3.7 perfectly.

archcra commented 9 years ago

What does you mean: after migrating to hammer 2.0 ? Maybe there is something misunderstanding.

tinyCucumber commented 7 years ago

Hi,i have used the module and finded the same problem.And i just want to know that the problem is solved or not?