Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android touch support #72

Closed
Martooo opened this issue Nov 9, 2011 · 10 comments
Closed

Android touch support #72

Martooo opened this issue Nov 9, 2011 · 10 comments

Comments

@Martooo
Copy link

Martooo commented Nov 9, 2011

Like the title suggested, this nice plugin runs smoothly in iOS but seems can not be touched and rotated on Android (tested on 2.2, they can rotate well though).

If possible, please kindly add the android support or simply expose some api (like "turn right") so user can use a button to rotate. I believe that will be a very interesting functionality and make more users love this little plugin.

Thanks.

Max

@pisi
Copy link
Owner

pisi commented Nov 11, 2011

Max,

Android support is a must these days, I fully agree. It's just that developing webstuff for Android (especially Javascript) is still such a pain - emulators are rubbish and the performance of actual hardware is rather silly if I may say. Reminds me a lot the early times of computing ;)

Actually, both your suggested solutions will hopefully land in upcoming version.

(1) I just recently finaly figured up a way how to effectively debug on Android devices and am already on track of the problems in Android. I finally got it to react on interaction, but it's still awful slow. I'm working on this one right now and willl keep you updated in this thread.

(2) As part of another issue #20, Reel will also be "reelable" without any dragging as it will allow to turn left/right by clicking left/right half of the image.

@ghost ghost assigned pisi Nov 11, 2011
@pisi
Copy link
Owner

pisi commented Nov 21, 2011

Good news everyone! During the weekend I've put my hands on friend's shiny new Android 2.3.3 smartphone and tested the new development version with a little modification and... It worked! :)

A little background: In order to not overwhelm the browser by all drag events the browser may be sending (essentially every mousemove or dragmove), Reel syncs this with the timer, so that just one "pan" event per one tick is processed. To do that Reel maintains a private Boolean variable slidable, which basicaly turns false on every processed pan/slide and is turned back to true by every tick. And this is what's not happening under Android. Some googling revealed, setTimeout is being blocked when dragging and that means no slidable reset by the timer, hence no more than just one pan/slide.

Removal of the slidable part of "pan" handler's wrapping condition allows for working interaction as one would expect from a "touchy" device :) There's still some glitch in attachments of touch events, but once I know now that the dragging works and having the better/recommended way of events attachment already explored in one experimental branch, I think I can safely conclude, that Android support is a done deal for 1.2.

@Martooo
Copy link
Author

Martooo commented Nov 23, 2011

Finally, the glory will return to Android... :D

Thanks for the super good news pisi !

@pisi
Copy link
Owner

pisi commented Dec 14, 2011

And I've just verified with my shiny new Android 2.3.5, that it indeed works. From 2.3 up. Yay! :)

@pisi
Copy link
Owner

pisi commented Dec 17, 2011

Current development branch contains support for touch interaction on Android OS available on 2.3+ (verified on 2.3.5 smartphone). @Martooo, can you please verify with your device? Thanks!

@Martooo
Copy link
Author

Martooo commented Dec 19, 2011

Thanks for the update. I currently do not have an Android 2.3 but I will upgrade or I will simply test it on my friend's phone and report back.

@pisi
Copy link
Owner

pisi commented Dec 21, 2011

I was originally aiming for 2.2, but as it turned out there was a bug causing the setTimeout to not be fired while the view was dragged, so I got as far to be able to spin the Reel by touch, but be able to see just the change once the finger was released. No further. Bummer... Luckily, Google got this fixed in 2.3.

@pisi
Copy link
Owner

pisi commented Dec 23, 2011

Calling for testers! Somebody with Android 2.3+ device, please, head on to the test sampler page of the current development branch, verify the interaction with the image is possible and drop me a note here. Thanks!

@pisi pisi closed this as completed Dec 23, 2011
@Martooo
Copy link
Author

Martooo commented Dec 29, 2011

Yeah, tested and confirmed on Sumsung I9100 Galaxy. Work like charm!

I believe it is the time to release this version so that all others can see this exciting change.

May the force be with you!

@pisi
Copy link
Owner

pisi commented Dec 29, 2011

Perfect! Thanks @Martooo
The time sure is now, but there is still one unresolved feature (#36) missing to be finalized. Then we're good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants