readium-js-viewer icon indicating copy to clipboard operation
readium-js-viewer copied to clipboard

Add Hammver V2 swipe gestures.

Open danielolivaresd opened this issue 9 years ago • 11 comments

Add capability to detect swipes (left and right) for changing pages. Use new Hammer v2 API syntax.

danielolivaresd avatar Feb 03 '16 04:02 danielolivaresd

Hello, thanks for the PR! In the past there were some issues with Hammer's event sub-system, and user-select / touch-action CSS overrides (e.g. delete Hammer.defaults.cssProps.userSelect) resulting in interferences with the iframes that Readium uses to host EPUB content documents (HTML / SVG files), in addition to problems related to the start and end point of touch swipe gestures (across the iframe boundaries ... in fixed-layout two-page-spread mode it even gets worse due to 2x contiguous iframes).

That's the main reservation against merging this right now. I think we need more thorough testing on different touch-enabled platforms (iOS, Android, and Windows 10 primarily?).

FYI, here's some experimental code that was used to debunk touch-related issues on Windows 10 / Edge, it's not pretty: https://github.com/readium/readium-js-viewer/compare/develop...danielweck:feature/touchSwipe#diff-99568d36162fffa1ff6e34886e38ed1e (note how Hammer is initialized, further down in the code diff)

danielweck avatar Feb 25 '16 18:02 danielweck

Hi Daniel,

I am trying to test readium-js-viewer's Touch UI on my Android phone, but swipe features are not working. I used the codes in "develop" branch.

Should I adjust any configuration in develop codes, or use another branch?

toshiakikoike avatar Jan 23 '18 02:01 toshiakikoike

Hello @toshiakikoike Well, looking at the code now, I see that "gesture handling" is totally disabled (i.e. touch support, finger swipe interactions for "previous/next page" commands): https://github.com/readium/readium-js-viewer/blob/66e8d21f0d10361326d098e413abedd8515d42e6/src/js/gestures.js#L19

I believe the rationale for disabling the "gesture handler" was that it was causing problems in the cloud reader on the various available web browsers at the time (on desktop and mobile platforms). The recommendation was to upgrade to a more recent version of Hammer (new API), and test on multiple platforms.

This Pull Request by Daniel Olivares is proposing a change, but this would need to be reviewed and tested based on the latest revision (head of the develop branch) of the cloud reader.

https://github.com/K1N5L4Y3R/readium-js-viewer/commit/11d61d86eeecad13f2ac9f8e2abf4e0826198079

I think the feature/touchSwipe branch in this repository is obsolete: https://github.com/readium/readium-js-viewer/compare/develop...feature/touchSwipe (better use this PR as a reference)

Feel free to run some tests and please let us know how it goes! :)

Kind regards, Daniel

danielweck avatar Jan 23 '18 14:01 danielweck

Thank you. I'll try.

toshiakikoike avatar Jan 24 '18 01:01 toshiakikoike

Progress report: I'd replace "src/js/gestures.js" in dev(2.30.0-alpha) to "K1N5L4Y3R/readium-js-viewer@11d61d8" and "npm run dist".

Result; "Swipe action" work well on virtual android/iOS by user-agent-switcher on Firefox. On iOS, it looks like well. But not work on real android device(Android 8.0.0/Chrome 64.0.3282.137).

I'll continue to try it.

toshiakikoike avatar Mar 06 '18 06:03 toshiakikoike

@toshiakikoike any update to this?

coler-j avatar Sep 25 '18 18:09 coler-j

@toshiakikoike any update to this?

Sorry, no update this.

toshiakikoike avatar Sep 26 '18 01:09 toshiakikoike

Is there a bounty system where I could pay someone to resolve this issue?

coler-j avatar Nov 05 '18 16:11 coler-j

bug bounty, this should be discussed on the Readium Slack, this is not a bad idea IMO.

llemeurfr avatar Nov 06 '18 08:11 llemeurfr

Where is the readium slack? I am very motivated to get this issue resolved (as well as a few others) and have a budget to do so.

coler-j avatar Nov 06 '18 12:11 coler-j

here you go ... https://readium-slack.herokuapp.com/

llemeurfr avatar Nov 06 '18 13:11 llemeurfr