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

Pan-Zoom control via touch gestures, disable reader.html meta viewport rescale #31

Open
danielweck opened this issue Oct 1, 2014 · 3 comments

Comments

@danielweck
Copy link
Member

readium-js-viewer has additional control for pan-zoom (combo box / pull-down list of zoom-fit options + arbitrary percentage value).
This should be achievable in native launchers via touch gestures (pinch / stretch).

@danielweck
Copy link
Member Author

Reflowble viewport is impacted as well:
readium/readium-sdk#84

@danielweck
Copy link
Member Author

@danielweck
Copy link
Member Author

So, let's do a thought exercise, running iOS Launcher on an iPad.

The root UIWebView document reader.html doesn't do much more than wrapping the iframes for each displayed EPUB content document (i.e. there is no UI "chrome", unlike the cloud reader navigation bar + page buttons), and right now its head>meta/viewport allows the user to use pinch/stretch gestures, with undesirable results: it may "look and feel okay" with fixed layout books (including panning the content with one-two finger drag), but with reflow documents it becomes very confusing.

One option is to "lock" the reader.html viewport:

<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,minimum-scale=1,maximum-scale=1">

This would mean that the touch interaction would not get consumed "natively" by the UIWebView to zoom in/out of the rendered pages, instead code in readium-shared-js would take care of capturing pinch/stretch gestures (maybe double-tap as well) to interpret them as appropriate. This would make it possible to use Readium's built-in "pan + zoom" feature API (just as with the Chrome extension / cloud reader, although this browser-based implementation doesn't handle touch gestures at this point (for anything other than page swipe), but instead provides a menu UI affordance for setting the zoom).

The problem with the above approach is that touch events would not be handled natively, the app would delegate this to the HTML viewport. Not to everybody's taste / vendor integration requirements.

As a point of discussion, it may be important to remember that the cloud reader's "zoom" UI may eventually be used to control reflow font size as well as pixel-perfect zoom, thereby harmonising the concept of "magnification" across pre-paginated fixed layout publications and reflowable documents. Should the iOS touch-based interaction also be used to control font size? (in addition to classic pinch-stretch zoom gestures) This would be a good argument for locking the viewport and installing a custom touch handler, as described above.

Food for thoughts.

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