diff options
author | Matt Holgate <matt@emobix.co.uk> | 2014-07-08 11:16:48 +0100 |
---|---|---|
committer | Matt Holgate <matt@emobix.co.uk> | 2014-07-08 11:17:30 +0100 |
commit | bd61a5f21b390631ee68a8bd3d3a674e37910093 (patch) | |
tree | 7a5e21a7e838135a4cd7907bef03ba2b758a1ad7 /platform/android | |
parent | dc7126d70ec1a9253cb6b344c77ea448bef4ca29 (diff) | |
download | mupdf-bd61a5f21b390631ee68a8bd3d3a674e37910093.tar.xz |
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.
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/src/com/artifex/mupdfdemo/ReaderView.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/platform/android/src/com/artifex/mupdfdemo/ReaderView.java b/platform/android/src/com/artifex/mupdfdemo/ReaderView.java index 2552e928..7cfcf4d1 100644 --- a/platform/android/src/com/artifex/mupdfdemo/ReaderView.java +++ b/platform/android/src/com/artifex/mupdfdemo/ReaderView.java @@ -56,7 +56,6 @@ public class ReaderView private final Stepper mStepper; private int mScrollerLastX; private int mScrollerLastY; - private boolean mScrollDisabled; static abstract class ViewMapper { abstract void applyToView(View view); @@ -366,7 +365,7 @@ public class ReaderView public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { - if (mScrollDisabled) + if (mScaling) return true; View v = mChildViews.get(mCurrent); @@ -424,7 +423,7 @@ public class ReaderView public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { - if (!mScrollDisabled) { + if (!mScaling) { mXScroll -= distanceX; mYScroll -= distanceY; requestLayout(); @@ -473,9 +472,6 @@ public class ReaderView // screen is not showing the effect of them, so they can // only confuse the user mXScroll = mYScroll = 0; - // Avoid jump at end of scaling by disabling scrolling - // until the next start of gesture - mScrollDisabled = true; return true; } @@ -494,15 +490,12 @@ public class ReaderView @Override public boolean onTouchEvent(MotionEvent event) { mScaleGestureDetector.onTouchEvent(event); - - if (!mScaling) - mGestureDetector.onTouchEvent(event); + mGestureDetector.onTouchEvent(event); if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) { mUserInteracting = true; } if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_UP) { - mScrollDisabled = false; mUserInteracting = false; View v = mChildViews.get(mCurrent); |