Bug 693228 - Mupdf/android has counter intuitive finger dragging behaviour...
Summary: Mupdf/android has counter intuitive finger dragging behaviour...
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: 1.0
Hardware: Android Phone Android
: P4 normal
Assignee: Paul Gardiner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-28 19:54 UTC by Sebastian Rasmussen
Modified: 2014-07-10 02:15 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
Proposed fix (1.91 KB, patch)
2013-10-18 07:43 UTC, Michaël Cadilhac
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Rasmussen 2012-07-28 19:54:37 UTC
Install mupdf-1.0-android.apk, then:

1. download a pdf with at least two pages
2. start the mupdf app
3. click the pdf in the list
4. navigate to the first page of the pdf
5. place your finger on the right hand side of the screen and drag left without letting go. while dragging page two will start to be visible
6. when your finger reaches the center of the screen drag right. while dragging page two will no longer be visible
7. repeat step 5
8. when your finger reaches the center of the screen add a second finger
8. move your second finger away from your first finger in order to zoom in
9. at some point release your second finger, to stop zooming
10. at this point you can drag your finger (which has been on the screen all the time since step 5) in any direction without anything happening
11. add your second again
12. move your second finger closer to your first finger in order to zoom out

In steps 5-6 it is obvious that you can drag in order to change page.
Steps 11-12 are added just to verify that we have entered zoom-mode and we can't leave it until we redraw at a higher resolution.

In step 10 it is counter intuitive that dragging your finger has no effect. Wouldn't it make sense to allow the user to drag to change page as in steps 5-6, albeit in the pixelized zoomed in mode? At least until the user releases his first finger at which point we redraw zoomed in at a higher resolution?
Comment 1 Michaël Cadilhac 2013-10-18 07:43:40 UTC
Created attachment 10331 [details]
Proposed fix

Sebastian: can you try applying this change to see if it fits your needs?

The behavior you're seeing was implemented on purpose.  When a Scaling starts, it disables scrolling by setting mScrollDisabled to true.  This is set back to false when ALL the pointers (fingers) are gone (ACTION_UP).  This is done to prevent "jumping" as the comment in ReaderView.java explains:

  // Avoid jump at end of scaling by disabling scrolling
  // until the next start of gesture

The idea being that when you use two fingers, the normal gesture detector is left out in favor of a ScalingGestureDetector.  When the normal gesture detector resumes its work, it sees that the scrolling finger is now at a different position, and this makes the scrolling "jump".  I believe not calling the normal GestureDetector when scaling is faulty: it should still be called, although its actions should be muted.  This allows the detector to follow the fingers neatly, and prevents the jumping when the actions are allowed to do their work.
Comment 2 Matt Holgate 2014-07-10 02:15:07 UTC
Thanks for the patch. Now committed:


commit bd61a5f21b390631ee68a8bd3d3a674e37910093
Author: Matt Holgate <matt@emobix.co.uk>
Date:   Tue Jul 8 11:16:48 2014 +0100

    Fix #693228 - Android has counter intuitive finger dragging behaviour

    Patch from Michaël Cadilhac.

    Continue to pass events to panning GestureDetector when zooming (but do not
    act on the reported gesture).

    Previously we just stopped sending events to the GestureDetector until the
    start of the next gesture.