mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
fixed no-animation scrolling
This commit is contained in:
parent
da8376c225
commit
f16565bfb1
4 changed files with 29 additions and 2 deletions
|
@ -236,6 +236,7 @@ class CurlAnimationProvider extends AnimationProvider {
|
|||
super.startAutoScrollingInternal(forward, startSpeed, direction, w, h, x, y, speed);
|
||||
mySpeedFactor = (float)Math.pow(2.0, 0.25 * speed);
|
||||
mySpeed *= 1.5;
|
||||
doStep();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,7 +21,9 @@ package org.geometerplus.zlibrary.ui.android.view;
|
|||
|
||||
import android.graphics.*;
|
||||
|
||||
class NoneAnimationProvider extends SimpleAnimationProvider {
|
||||
import org.geometerplus.zlibrary.core.view.ZLView;
|
||||
|
||||
class NoneAnimationProvider extends AnimationProvider {
|
||||
private final Paint myPaint = new Paint();
|
||||
|
||||
NoneAnimationProvider(BitmapManager bitmapManager) {
|
||||
|
@ -39,4 +41,28 @@ class NoneAnimationProvider extends SimpleAnimationProvider {
|
|||
terminate();
|
||||
}
|
||||
}
|
||||
|
||||
private ZLView.PageIndex myPageToScrollTo = ZLView.PageIndex.current;
|
||||
|
||||
@Override
|
||||
protected void startAutoScrollingInternal(boolean forward, float startSpeed, ZLView.Direction direction, int w, int h, Integer x, Integer y, int speed) {
|
||||
super.startAutoScrollingInternal(forward, startSpeed, direction, w, h, x, y, speed);
|
||||
switch (direction) {
|
||||
case rightToLeft:
|
||||
case up:
|
||||
myPageToScrollTo =
|
||||
startSpeed > 0 ? ZLView.PageIndex.previous : ZLView.PageIndex.next;
|
||||
break;
|
||||
case leftToRight:
|
||||
case down:
|
||||
myPageToScrollTo =
|
||||
startSpeed > 0 ? ZLView.PageIndex.next : ZLView.PageIndex.previous;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
ZLView.PageIndex getPageToScrollTo() {
|
||||
return myPageToScrollTo;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ abstract class SimpleAnimationProvider extends AnimationProvider {
|
|||
protected void startAutoScrollingInternal(boolean forward, float startSpeed, ZLView.Direction direction, int w, int h, Integer x, Integer y, int speed) {
|
||||
super.startAutoScrollingInternal(forward, startSpeed, direction, w, h, x, y, speed);
|
||||
mySpeedFactor = (float)Math.pow(1.5, 0.25 * speed);
|
||||
doStep();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -190,7 +190,6 @@ public class ZLAndroidWidget extends View implements View.OnLongClickListener {
|
|||
animator.startAutoScrolling(true, -3, direction, w, h, x, y, speed);
|
||||
break;
|
||||
}
|
||||
animator.doStep();
|
||||
postInvalidate();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue