-
Notifications
You must be signed in to change notification settings - Fork 43
implement scroll and page turn using gestures #34
Comments
Coding idea: //where to get the actual view with visual positions x and y? |
working code for paging by horizontal swipe dispatchTouchEvent catches all touch events, so also the vertical scroll, need help to integrate. Advantage: no buttons needed, full flicker-free page turns and (flickering) sub-page scroll by gestures.
|
previous code should read |
"final" version
float x,y; |
Horizontal swipes turning "pages" - a concept that does not exist in the application - is very confusing in presence of multiple articles of the same title. Why would a right-to-left swipe, for example, turn "page" instead of going back? Also, swiping gestures where present in one of early versions, implemented with Adroid's gesture API, but that proved to be brittle and broke down completely in Android 2.2 and was removed. Also, there's no real difference between horizontal and vertical direction, even if horizontal scrolling shows up a lot less often because article text can usually be re-flowed to avoid it. Swipe gestures don't interact very well with regular scrolling, which is probably why they are not implemented in the standard Android Browser. Article viewing in aarddict is very much like viewing a web page. I think trying to implementn book-style navigation on it is a bad idea. |
The big advantage I see is to get rid of the hardware button discussion, which comes with the e-readers. They are originally conceived as market channels and have a proprietariy hardware as well as their shops. If there are pictures or other content which does not reflow - you are right, a gesture which takes the horizontal scroll away and uses it for page turn would be counterproductive. But I have not met any examples. Personally, I like the proposed navigation very much. Most of the time I can proceed pagewise with a little horizontal gesture like reading a book, if a table or other context needs alignment, I can tear it to where I want it. So I actually like the book-style navigation. Probably a question of taste. But anyway, there is a need to implement full page turns, using scrolling had the two drawbacks:
Thanks again |
I mean, of course, the application whose issue tracker this is - Aard Dictionary. I have nothing against the concept of pages and page turning in e-book readers, but Aard Dictionary is not an e-book reader, never had such ambitions or design goals. It is cool that it happens to run on a variety of devices including those I never thought of, but let's not get carried away, it doesn't change the fact that Wikipedia, Wiktionary and other similar data sources for which Aard Dictionary is made are not really books. As for examples of horizontal scrolling, they are certainly not hard to come by: open any Wikipedia article with tables, such as "Periodic Table" or large formulas like "Table of Integrals". |
OK, got me. I will think about other methods to combine/distinguish scrolls and full page turns, like speed of swipe. One drawback of the dispatchTouchEvent command is that it also swallows the links. |
Page turns result in much lower flicker on e-ink devices than scrolling, yet scrolling is necessary to align pages.
The handling of hardware buttons for page turns is quite devices dependent, so why not do the entire navigation using gestures:
A vertical swipe would scroll, as already implemented.
A horizontal swipe would turn the page back or forth.
Just takes a little checking and thresholds for x and y.
What is the coordinate system used in e.g. the Scrollto function? How can a delta x or delta y be detected?
The text was updated successfully, but these errors were encountered: