diff --git a/library/src/main/java/com/ebr163/bifacialview/view/BifacialView.java b/library/src/main/java/com/ebr163/bifacialview/view/BifacialView.java index 0fb4513..0ce5a00 100644 --- a/library/src/main/java/com/ebr163/bifacialview/view/BifacialView.java +++ b/library/src/main/java/com/ebr163/bifacialview/view/BifacialView.java @@ -168,22 +168,18 @@ public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: - if (touchMode == TouchMode.DELIMITER) { - if (x > delimiterPosition + delimiterPadding || x < delimiterPosition - delimiterPadding) { - return false; - } else { - getParent().requestDisallowInterceptTouchEvent(true); - } + if ((touchMode == TouchMode.DELIMITER) && + (x > delimiterPosition + delimiterPadding || x < delimiterPosition - delimiterPadding)) { + return false; } + getParent().requestDisallowInterceptTouchEvent(true); case MotionEvent.ACTION_MOVE: isMove = true; break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: isMove = false; - if (touchMode == TouchMode.DELIMITER) { - getParent().requestDisallowInterceptTouchEvent(false); - } + getParent().requestDisallowInterceptTouchEvent(false); break; } delimiterPosition = (int) (x / 1);