mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 18:29:23 +02:00
better fix for touch/volume key scrolling
This commit is contained in:
parent
dfe3165cfd
commit
e7ca10f8d9
1 changed files with 23 additions and 10 deletions
|
@ -199,16 +199,6 @@ public class ZLAndroidWidget extends View implements View.OnLongClickListener {
|
||||||
}
|
}
|
||||||
setPageToScrollTo(ZLView.PageIndex.current);
|
setPageToScrollTo(ZLView.PageIndex.current);
|
||||||
myScrollingState = ScrollingState.NoScrolling;
|
myScrollingState = ScrollingState.NoScrolling;
|
||||||
myStartX = 0;
|
|
||||||
myStartY = 0;
|
|
||||||
myEndX = 0;
|
|
||||||
myEndY = 0;
|
|
||||||
getAnimationProvider().setup(
|
|
||||||
myStartX, myStartY,
|
|
||||||
myEndX, myEndY,
|
|
||||||
myScrollHorizontally,
|
|
||||||
getWidth(), getMainAreaHeight()
|
|
||||||
);
|
|
||||||
onDrawStatic(canvas);
|
onDrawStatic(canvas);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -277,6 +267,7 @@ public class ZLAndroidWidget extends View implements View.OnLongClickListener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
myScrollHorizontally = horizontally;
|
myScrollHorizontally = horizontally;
|
||||||
|
boolean doSetup = myScrollingState == ScrollingState.NoScrolling;
|
||||||
switch (pageIndex) {
|
switch (pageIndex) {
|
||||||
case current:
|
case current:
|
||||||
switch (myPageToScrollTo) {
|
switch (myPageToScrollTo) {
|
||||||
|
@ -308,6 +299,28 @@ public class ZLAndroidWidget extends View implements View.OnLongClickListener {
|
||||||
setPageToScrollTo(pageIndex);
|
setPageToScrollTo(pageIndex);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
System.err.println(doSetup + ":" + myScrollingState);
|
||||||
|
if (doSetup && myScrollingState != ScrollingState.NoScrolling) {
|
||||||
|
//getAnimationProvider().setup(
|
||||||
|
// myScrollHorizontally,
|
||||||
|
// getWidth(), getMainAreaHeight()
|
||||||
|
//);
|
||||||
|
if (myScrollHorizontally) {
|
||||||
|
myStartX = myScrollingSpeed < 0 ? getWidth() : 0;
|
||||||
|
myStartY = 0;
|
||||||
|
} else {
|
||||||
|
myStartX = 0;
|
||||||
|
myStartY = myScrollingSpeed < 0 ? getMainAreaHeight() : 0;
|
||||||
|
}
|
||||||
|
myEndX = myStartX;
|
||||||
|
myEndY = myStartY;
|
||||||
|
getAnimationProvider().setup(
|
||||||
|
myStartX, myStartY,
|
||||||
|
myEndX, myEndY,
|
||||||
|
myScrollHorizontally,
|
||||||
|
getWidth(), getMainAreaHeight()
|
||||||
|
);
|
||||||
|
}
|
||||||
drawOnBitmap(mySecondaryBitmap);
|
drawOnBitmap(mySecondaryBitmap);
|
||||||
postInvalidate();
|
postInvalidate();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue