Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
gedoor committed Aug 29, 2018
1 parent 563e241 commit 1a64c40
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/src/main/java/com/monke/monkeybook/widget/page/PageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,13 @@ protected void onDraw(Canvas canvas) {
public boolean onTouchEvent(MotionEvent event) {
super.onTouchEvent(event);

if (!canTouch && event.getAction() != MotionEvent.ACTION_DOWN) return true;
if (mPageAnim == null) {
return true;
}

if (!canTouch && event.getAction() != MotionEvent.ACTION_DOWN) {
return true;
}

int x = (int) event.getX();
int y = (int) event.getY();
Expand All @@ -227,9 +233,7 @@ public boolean onTouchEvent(MotionEvent event) {
mStartX = x;
mStartY = y;
isMove = false;
if (mTouchListener != null) {
canTouch = mTouchListener.onTouch();
}
canTouch = mTouchListener.onTouch();
mPageAnim.onTouchEvent(event);
break;
case MotionEvent.ACTION_MOVE:
Expand Down Expand Up @@ -272,8 +276,6 @@ public boolean onTouchEvent(MotionEvent event) {

/**
* 判断是否存在上一页
*
* @return
*/
private boolean hasPrevPage() {
if (mPageLoader.prev()) {
Expand All @@ -286,8 +288,6 @@ private boolean hasPrevPage() {

/**
* 判断是否下一页存在
*
* @return
*/
private boolean hasNextPage() {
if (mPageLoader.next()) {
Expand Down

0 comments on commit 1a64c40

Please sign in to comment.