mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 19:42:17 +02:00
cleanup
This commit is contained in:
parent
eb4cc8b095
commit
5613be82ba
2 changed files with 10 additions and 10 deletions
|
@ -187,7 +187,7 @@ public final class FBView extends ZLTextView {
|
|||
final boolean horizontal = ScrollingPreferences.Instance().HorizontalOption.getValue();
|
||||
final int diff = horizontal ? x - myStartX : y - myStartY;
|
||||
if (diff > 0) {
|
||||
ZLTextWordCursor cursor = getStartCursor();
|
||||
final ZLTextWordCursor cursor = getStartCursor();
|
||||
if (cursor == null || cursor.isNull()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ public final class FBView extends ZLTextView {
|
|||
myReader.scrollViewManually(horizontal ? PAGE_LEFT : PAGE_TOP, myStartX, myStartY, x, y);
|
||||
}
|
||||
} else if (diff < 0) {
|
||||
ZLTextWordCursor cursor = getEndCursor();
|
||||
final ZLTextWordCursor cursor = getEndCursor();
|
||||
if (cursor == null || cursor.isNull()) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -138,8 +138,8 @@ public class ZLAndroidWidget extends View implements View.OnLongClickListener {
|
|||
myScrollingSpeed *= 1.5;
|
||||
}
|
||||
final boolean horizontal =
|
||||
(myViewPageToScroll == ZLView.PAGE_RIGHT) ||
|
||||
(myViewPageToScroll == ZLView.PAGE_LEFT);
|
||||
myViewPageToScroll == ZLView.PAGE_RIGHT ||
|
||||
myViewPageToScroll == ZLView.PAGE_LEFT;
|
||||
final int size = horizontal ? w : h;
|
||||
int shift = myScrollingShift < 0 ? myScrollingShift + size : myScrollingShift - size;
|
||||
switch (view.getAnimationType()) {
|
||||
|
@ -267,8 +267,8 @@ public class ZLAndroidWidget extends View implements View.OnLongClickListener {
|
|||
|
||||
public void scrollManually(int viewPage, int startX, int startY, int endX, int endY) {
|
||||
final boolean horizontal =
|
||||
(viewPage == ZLView.PAGE_RIGHT) ||
|
||||
(viewPage == ZLView.PAGE_LEFT);
|
||||
viewPage == ZLView.PAGE_RIGHT ||
|
||||
viewPage == ZLView.PAGE_LEFT;
|
||||
final int shift = horizontal ? endX - startX : endY - startY;
|
||||
|
||||
if (myMainBitmap == null) {
|
||||
|
@ -602,8 +602,8 @@ public class ZLAndroidWidget extends View implements View.OnLongClickListener {
|
|||
final int from = view.getScrollbarThumbLength(ZLView.PAGE_CENTRAL);
|
||||
final int to = view.getScrollbarThumbLength(myViewPageToScroll);
|
||||
final boolean horizontal =
|
||||
(myViewPageToScroll == ZLView.PAGE_RIGHT) ||
|
||||
(myViewPageToScroll == ZLView.PAGE_LEFT);
|
||||
myViewPageToScroll == ZLView.PAGE_RIGHT ||
|
||||
myViewPageToScroll == ZLView.PAGE_LEFT;
|
||||
final int size = horizontal ? getWidth() : getMainAreaHeight();
|
||||
final int shift = Math.abs(myScrollingShift);
|
||||
return (from * (size - shift) + to * shift) / size;
|
||||
|
@ -621,8 +621,8 @@ public class ZLAndroidWidget extends View implements View.OnLongClickListener {
|
|||
final int from = view.getScrollbarThumbPosition(ZLView.PAGE_CENTRAL);
|
||||
final int to = view.getScrollbarThumbPosition(myViewPageToScroll);
|
||||
final boolean horizontal =
|
||||
(myViewPageToScroll == ZLView.PAGE_RIGHT) ||
|
||||
(myViewPageToScroll == ZLView.PAGE_LEFT);
|
||||
myViewPageToScroll == ZLView.PAGE_RIGHT ||
|
||||
myViewPageToScroll == ZLView.PAGE_LEFT;
|
||||
final int size = horizontal ? getWidth() : getMainAreaHeight();
|
||||
final int shift = Math.abs(myScrollingShift);
|
||||
return (from * (size - shift) + to * shift) / size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue