+ 5
Can anyone explain why this code doesn't work on Android?
I wrote this code to demonstrate a way to detect swipes left and right and it works fine on iOS but doesn't seem to work for Android users. Can anyone explain why? https://code.sololearn.com/WIdKWjQ5UssG/?ref=app
9 Answers
+ 5
its interesting how different it is.
usually to take touch coordinates i need to take the array-like touch object from the event, the reason for that is multitouch.
ex.
swipedown = e.touches[0].pageX
we also cant directly take the coordinates from the touchend, because the array-like object is empty by then. and so touchmove event were used to update the touch position, that can be use later in touch end
https://code.sololearn.com/WQ2uOR86jRHs/?ref=app
+ 5
Could also use e.changedTouches[0].pageX
https://code.sololearn.com/WnfjdLm96l2s/#js
+ 4
Taste It works perfectly for me too! Thanks a lot! đ
+ 4
Great addition to the discussion - thanks ODLNT !
+ 3
Taste Great answer, thank you!
Would it be possible for you to build a small working demo to show how it needs to be done for Android? I wouldn't normally ask but, obviously, I'm unable to test it myself.
+ 3
Russ i just attached the code, let me know its behavior in ios
+ 3
i see, good to know the method i used also work in ios
thank you
0
I can't understand that what do here does
Please if who know about here do help me!!!