summaryrefslogtreecommitdiff
path: root/platform/android/src/com/artifex/mupdfdemo/ReaderView.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/com/artifex/mupdfdemo/ReaderView.java')
-rw-r--r--platform/android/src/com/artifex/mupdfdemo/ReaderView.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/platform/android/src/com/artifex/mupdfdemo/ReaderView.java b/platform/android/src/com/artifex/mupdfdemo/ReaderView.java
index fe183945..c2093534 100644
--- a/platform/android/src/com/artifex/mupdfdemo/ReaderView.java
+++ b/platform/android/src/com/artifex/mupdfdemo/ReaderView.java
@@ -53,6 +53,7 @@ public class ReaderView
private final ScaleGestureDetector
mScaleGestureDetector;
private final Scroller mScroller;
+ private final Stepper mStepper;
private int mScrollerLastX;
private int mScrollerLastY;
private boolean mScrollDisabled;
@@ -66,6 +67,7 @@ public class ReaderView
mGestureDetector = new GestureDetector(this);
mScaleGestureDetector = new ScaleGestureDetector(context, this);
mScroller = new Scroller(context);
+ mStepper = new Stepper(this, this);
}
public ReaderView(Context context, AttributeSet attrs) {
@@ -73,6 +75,7 @@ public class ReaderView
mGestureDetector = new GestureDetector(this);
mScaleGestureDetector = new ScaleGestureDetector(context, this);
mScroller = new Scroller(context);
+ mStepper = new Stepper(this, this);
}
public ReaderView(Context context, AttributeSet attrs, int defStyle) {
@@ -80,6 +83,7 @@ public class ReaderView
mGestureDetector = new GestureDetector(this);
mScaleGestureDetector = new ScaleGestureDetector(context, this);
mScroller = new Scroller(context);
+ mStepper = new Stepper(this, this);
}
public int getDisplayedViewIndex() {
@@ -203,7 +207,7 @@ public class ReaderView
}
mScrollerLastX = mScrollerLastY = 0;
mScroller.startScroll(0, 0, remainingX - xOffset, remainingY - yOffset, 400);
- post(this);
+ mStepper.prod();
}
public void smartMoveBackwards() {
@@ -275,7 +279,7 @@ public class ReaderView
}
mScrollerLastX = mScrollerLastY = 0;
mScroller.startScroll(0, 0, remainingX - xOffset, remainingY - yOffset, 400);
- post(this);
+ mStepper.prod();
}
public void resetupChildren() {
@@ -331,7 +335,7 @@ public class ReaderView
mScrollerLastX = x;
mScrollerLastY = y;
requestLayout();
- post(this);
+ mStepper.prod();
}
else if (!mUserInteracting) {
// End of an inertial scroll and the user is not interacting.
@@ -395,7 +399,7 @@ public class ReaderView
if(withinBoundsInDirectionOfTravel(bounds, velocityX, velocityY)
&& expandedBounds.contains(0, 0)) {
mScroller.fling(0, 0, (int)velocityX, (int)velocityY, bounds.left, bounds.right, bounds.top, bounds.bottom);
- post(this);
+ mStepper.prod();
}
}
@@ -536,7 +540,7 @@ public class ReaderView
postUnsettle(cv);
// post to invoke test for end of animation
// where we must set hq area for the new current view
- post(this);
+ mStepper.prod();
onMoveOffChild(mCurrent);
mCurrent++;
@@ -547,7 +551,7 @@ public class ReaderView
postUnsettle(cv);
// post to invoke test for end of animation
// where we must set hq area for the new current view
- post(this);
+ mStepper.prod();
onMoveOffChild(mCurrent);
mCurrent--;
@@ -592,7 +596,7 @@ public class ReaderView
}
// post to ensure generation of hq area
- post(this);
+ mStepper.prod();
}
// Ensure current view is present
@@ -777,7 +781,7 @@ public class ReaderView
if (corr.x != 0 || corr.y != 0) {
mScrollerLastX = mScrollerLastY = 0;
mScroller.startScroll(0, 0, corr.x, corr.y, 400);
- post(this);
+ mStepper.prod();
}
}