diff --git a/src/org/geometerplus/fbreader/fbreader/FBView.java b/src/org/geometerplus/fbreader/fbreader/FBView.java index 902f22da6e3..f1ec9427866 100644 --- a/src/org/geometerplus/fbreader/fbreader/FBView.java +++ b/src/org/geometerplus/fbreader/fbreader/FBView.java @@ -195,7 +195,7 @@ public boolean onFingerRelease(int x, int y) { } if (isFlickScrollingEnabled()) { - myReader.getViewWidget().startAutoScrolling( + myReader.getViewWidget().startAnimatedScrolling( x, y, ScrollingPreferences.Instance().AnimationSpeedOption.getValue() ); return true; diff --git a/src/org/geometerplus/fbreader/fbreader/TurnPageAction.java b/src/org/geometerplus/fbreader/fbreader/TurnPageAction.java index c316e574e97..bdce37dfd99 100644 --- a/src/org/geometerplus/fbreader/fbreader/TurnPageAction.java +++ b/src/org/geometerplus/fbreader/fbreader/TurnPageAction.java @@ -39,7 +39,7 @@ public boolean isEnabled() { public void run() { final ScrollingPreferences preferences = ScrollingPreferences.Instance(); - Reader.getViewWidget().startAutoScrolling( + Reader.getViewWidget().startAnimatedScrolling( myForward ? FBView.PageIndex.next : FBView.PageIndex.previous, preferences.HorizontalOption.getValue() ? FBView.Direction.rightToLeft : FBView.Direction.up, @@ -49,7 +49,7 @@ public void run() { public void runWithCoordinates(int x, int y) { final ScrollingPreferences preferences = ScrollingPreferences.Instance(); - Reader.getViewWidget().startAutoScrolling( + Reader.getViewWidget().startAnimatedScrolling( myForward ? FBView.PageIndex.next : FBView.PageIndex.previous, x, y, preferences.HorizontalOption.getValue() diff --git a/src/org/geometerplus/fbreader/fbreader/VolumeKeyTurnPageAction.java b/src/org/geometerplus/fbreader/fbreader/VolumeKeyTurnPageAction.java index 286b24a940f..be797dd5f70 100755 --- a/src/org/geometerplus/fbreader/fbreader/VolumeKeyTurnPageAction.java +++ b/src/org/geometerplus/fbreader/fbreader/VolumeKeyTurnPageAction.java @@ -39,7 +39,7 @@ public void run() { forward = !forward; } - Reader.getViewWidget().startAutoScrolling( + Reader.getViewWidget().startAnimatedScrolling( forward ? FBView.PageIndex.next : FBView.PageIndex.previous, preferences.HorizontalOption.getValue() ? FBView.Direction.rightToLeft : FBView.Direction.up, diff --git a/src/org/geometerplus/zlibrary/core/view/ZLViewWidget.java b/src/org/geometerplus/zlibrary/core/view/ZLViewWidget.java index c0d28d0ebb2..691f597b004 100644 --- a/src/org/geometerplus/zlibrary/core/view/ZLViewWidget.java +++ b/src/org/geometerplus/zlibrary/core/view/ZLViewWidget.java @@ -25,7 +25,7 @@ public interface ZLViewWidget { void startManualScrolling(int x, int y, ZLView.Direction direction); void scrollManuallyTo(int x, int y); - void startAutoScrolling(ZLView.PageIndex pageIndex, int x, int y, ZLView.Direction direction, int speed); - void startAutoScrolling(ZLView.PageIndex pageIndex, ZLView.Direction direction, int speed); - void startAutoScrolling(int x, int y, int speed); + void startAnimatedScrolling(ZLView.PageIndex pageIndex, int x, int y, ZLView.Direction direction, int speed); + void startAnimatedScrolling(ZLView.PageIndex pageIndex, ZLView.Direction direction, int speed); + void startAnimatedScrolling(int x, int y, int speed); } diff --git a/src/org/geometerplus/zlibrary/ui/android/view/AnimationProvider.java b/src/org/geometerplus/zlibrary/ui/android/view/AnimationProvider.java index c7c4c1a5aab..e5249328580 100644 --- a/src/org/geometerplus/zlibrary/ui/android/view/AnimationProvider.java +++ b/src/org/geometerplus/zlibrary/ui/android/view/AnimationProvider.java @@ -30,8 +30,8 @@ abstract class AnimationProvider { static enum Mode { NoScrolling(false), ManualScrolling(false), - AutoScrollingForward(true), - AutoScrollingBackward(true); + AnimatedScrollingForward(true), + AnimatedScrollingBackward(true); final boolean Auto; @@ -81,7 +81,7 @@ void scrollTo(int x, int y) { } } - void startAutoScrolling(int x, int y, int speed) { + void startAnimatedScrolling(int x, int y, int speed) { if (myMode != Mode.ManualScrolling) { return; } @@ -96,7 +96,7 @@ void startAutoScrolling(int x, int y, int speed) { (myHeight > myWidth ? myHeight / 4 : myHeight / 3); boolean forward = Math.abs(diff) > minDiff; - myMode = forward ? Mode.AutoScrollingForward : Mode.AutoScrollingBackward; + myMode = forward ? Mode.AnimatedScrollingForward : Mode.AnimatedScrollingBackward; float velocity = 15; if (myDrawInfos.size() > 1) { @@ -136,16 +136,16 @@ void startAutoScrolling(int x, int y, int speed) { break; } - startAutoScrollingInternal(speed); + startAnimatedScrollingInternal(speed); } - public void startAutoScrolling(ZLView.PageIndex pageIndex, Integer x, Integer y, int speed) { + public void startAnimatedScrolling(ZLView.PageIndex pageIndex, Integer x, Integer y, int speed) { if (myMode.Auto) { return; } terminate(); - myMode = Mode.AutoScrollingForward; + myMode = Mode.AnimatedScrollingForward; switch (myDirection) { case up: @@ -157,12 +157,12 @@ public void startAutoScrolling(ZLView.PageIndex pageIndex, Integer x, Integer y, mySpeed = pageIndex == ZLView.PageIndex.next ? 15 : -15; break; } - setupAutoScrollingStart(x, y); - startAutoScrollingInternal(speed); + setupAnimatedScrollingStart(x, y); + startAnimatedScrollingInternal(speed); } - protected abstract void startAutoScrollingInternal(int speed); - protected abstract void setupAutoScrollingStart(Integer x, Integer y); + protected abstract void startAnimatedScrollingInternal(int speed); + protected abstract void setupAnimatedScrollingStart(Integer x, Integer y); boolean inProgress() { return myMode != Mode.NoScrolling; diff --git a/src/org/geometerplus/zlibrary/ui/android/view/CurlAnimationProvider.java b/src/org/geometerplus/zlibrary/ui/android/view/CurlAnimationProvider.java index 3c61e8edadb..54589d2fd51 100644 --- a/src/org/geometerplus/zlibrary/ui/android/view/CurlAnimationProvider.java +++ b/src/org/geometerplus/zlibrary/ui/android/view/CurlAnimationProvider.java @@ -199,14 +199,14 @@ ZLView.PageIndex getPageToScrollTo(int x, int y) { } @Override - protected void startAutoScrollingInternal(int speed) { + protected void startAnimatedScrollingInternal(int speed) { mySpeedFactor = (float)Math.pow(2.0, 0.25 * speed); mySpeed *= 1.5; doStep(); } @Override - protected void setupAutoScrollingStart(Integer x, Integer y) { + protected void setupAnimatedScrollingStart(Integer x, Integer y) { if (x == null || y == null) { if (myDirection.IsHorizontal) { x = mySpeed < 0 ? myWidth - 3 : 3; @@ -245,7 +245,7 @@ void doStep() { final int cornerY = myStartY > myHeight / 2 ? myHeight : 0; final int boundX, boundY; - if (getMode() == Mode.AutoScrollingForward) { + if (getMode() == Mode.AnimatedScrollingForward) { boundX = cornerX == 0 ? 2 * myWidth : -myWidth; boundY = cornerY == 0 ? 2 * myHeight : -myHeight; } else { @@ -268,7 +268,7 @@ void doStep() { } final boolean xSpeedIsPositive, ySpeedIsPositive; - if (getMode() == Mode.AutoScrollingForward) { + if (getMode() == Mode.AnimatedScrollingForward) { xSpeedIsPositive = cornerX == 0; ySpeedIsPositive = cornerY == 0; } else { diff --git a/src/org/geometerplus/zlibrary/ui/android/view/NoneAnimationProvider.java b/src/org/geometerplus/zlibrary/ui/android/view/NoneAnimationProvider.java index bc944923481..c3ce766cf77 100644 --- a/src/org/geometerplus/zlibrary/ui/android/view/NoneAnimationProvider.java +++ b/src/org/geometerplus/zlibrary/ui/android/view/NoneAnimationProvider.java @@ -43,7 +43,7 @@ void doStep() { } @Override - protected void setupAutoScrollingStart(Integer x, Integer y) { + protected void setupAnimatedScrollingStart(Integer x, Integer y) { if (myDirection.IsHorizontal) { myStartX = mySpeed < 0 ? myWidth : 0; myEndX = myWidth - myStartX; @@ -56,7 +56,7 @@ protected void setupAutoScrollingStart(Integer x, Integer y) { } @Override - protected void startAutoScrollingInternal(int speed) { + protected void startAnimatedScrollingInternal(int speed) { } @Override diff --git a/src/org/geometerplus/zlibrary/ui/android/view/SimpleAnimationProvider.java b/src/org/geometerplus/zlibrary/ui/android/view/SimpleAnimationProvider.java index e1448d3d349..c7351ba4c63 100644 --- a/src/org/geometerplus/zlibrary/ui/android/view/SimpleAnimationProvider.java +++ b/src/org/geometerplus/zlibrary/ui/android/view/SimpleAnimationProvider.java @@ -48,7 +48,7 @@ ZLView.PageIndex getPageToScrollTo(int x, int y) { } @Override - protected void setupAutoScrollingStart(Integer x, Integer y) { + protected void setupAnimatedScrollingStart(Integer x, Integer y) { if (x == null || y == null) { if (myDirection.IsHorizontal) { x = mySpeed < 0 ? myWidth : 0; @@ -63,7 +63,7 @@ protected void setupAutoScrollingStart(Integer x, Integer y) { } @Override - protected void startAutoScrollingInternal(int speed) { + protected void startAnimatedScrollingInternal(int speed) { mySpeedFactor = (float)Math.pow(1.5, 0.25 * speed); doStep(); } @@ -89,7 +89,7 @@ void doStep() { break; } final int bound; - if (getMode() == Mode.AutoScrollingForward) { + if (getMode() == Mode.AnimatedScrollingForward) { bound = myDirection.IsHorizontal ? myWidth : myHeight; } else { bound = 0; diff --git a/src/org/geometerplus/zlibrary/ui/android/view/ZLAndroidWidget.java b/src/org/geometerplus/zlibrary/ui/android/view/ZLAndroidWidget.java index 23336826e52..876991993b4 100644 --- a/src/org/geometerplus/zlibrary/ui/android/view/ZLAndroidWidget.java +++ b/src/org/geometerplus/zlibrary/ui/android/view/ZLAndroidWidget.java @@ -132,7 +132,7 @@ private void onDrawInScrolling(Canvas canvas) { drawFooter(canvas); } else { switch (oldMode) { - case AutoScrollingForward: + case AnimatedScrollingForward: { final ZLView.PageIndex index = animator.getPageToScrollTo(); myBitmapManager.shift(index == ZLView.PageIndex.next); @@ -140,7 +140,7 @@ private void onDrawInScrolling(Canvas canvas) { ZLApplication.Instance().onRepaintFinished(); break; } - case AutoScrollingBackward: + case AnimatedScrollingBackward: view.onScrollingFinished(ZLView.PageIndex.current); break; } @@ -171,40 +171,40 @@ public void scrollManuallyTo(int x, int y) { } } - public void startAutoScrolling(ZLView.PageIndex pageIndex, int x, int y, ZLView.Direction direction, int speed) { + public void startAnimatedScrolling(ZLView.PageIndex pageIndex, int x, int y, ZLView.Direction direction, int speed) { final ZLView view = ZLApplication.Instance().getCurrentView(); if (pageIndex == ZLView.PageIndex.current || !view.canScroll(pageIndex)) { return; } final AnimationProvider animator = getAnimationProvider(); animator.setup(direction, getWidth(), getMainAreaHeight()); - animator.startAutoScrolling(pageIndex, x, y, speed); + animator.startAnimatedScrolling(pageIndex, x, y, speed); if (animator.getMode().Auto) { postInvalidate(); } } - public void startAutoScrolling(ZLView.PageIndex pageIndex, ZLView.Direction direction, int speed) { + public void startAnimatedScrolling(ZLView.PageIndex pageIndex, ZLView.Direction direction, int speed) { final ZLView view = ZLApplication.Instance().getCurrentView(); if (pageIndex == ZLView.PageIndex.current || !view.canScroll(pageIndex)) { return; } final AnimationProvider animator = getAnimationProvider(); animator.setup(direction, getWidth(), getMainAreaHeight()); - animator.startAutoScrolling(pageIndex, null, null, speed); + animator.startAnimatedScrolling(pageIndex, null, null, speed); if (animator.getMode().Auto) { postInvalidate(); } } - public void startAutoScrolling(int x, int y, int speed) { + public void startAnimatedScrolling(int x, int y, int speed) { final ZLView view = ZLApplication.Instance().getCurrentView(); final AnimationProvider animator = getAnimationProvider(); if (!view.canScroll(animator.getPageToScrollTo(x, y))) { animator.terminate(); return; } - animator.startAutoScrolling(x, y, speed); + animator.startAnimatedScrolling(x, y, speed); postInvalidate(); }