@Test(expected = IllegalArgumentException.class) public void shouldThrowAnExceptionWhenMotionEventIsNull() { swipe.dispatchTouchEvent(null); }
public boolean dispatchTouchEvent(final MotionEvent event) { checkNotNull(event, "event == null"); boolean isEventConsumed = false; switch (event.getAction()) { case MotionEvent.ACTION_DOWN: onActionDown(event); break; case MotionEvent.ACTION_UP: isEventConsumed = onActionUp(event); break; case MotionEvent.ACTION_MOVE: onActionMove(event); break; default: break; } return isEventConsumed; }
Swipe { public boolean dispatchTouchEvent(final MotionEvent event) { checkNotNull(event, "event == null"); boolean isEventConsumed = false; switch (event.getAction()) { case MotionEvent.ACTION_DOWN: onActionDown(event); break; case MotionEvent.ACTION_UP: isEventConsumed = onActionUp(event); break; case MotionEvent.ACTION_MOVE: onActionMove(event); break; default: break; } return isEventConsumed; } }
Swipe { public boolean dispatchTouchEvent(final MotionEvent event) { checkNotNull(event, "event == null"); boolean isEventConsumed = false; switch (event.getAction()) { case MotionEvent.ACTION_DOWN: onActionDown(event); break; case MotionEvent.ACTION_UP: isEventConsumed = onActionUp(event); break; case MotionEvent.ACTION_MOVE: onActionMove(event); break; default: break; } return isEventConsumed; } Swipe();  Swipe(int swipingThreshold, int swipedThreshold); }
Swipe { public boolean dispatchTouchEvent(final MotionEvent event) { checkNotNull(event, "event == null"); boolean isEventConsumed = false; switch (event.getAction()) { case MotionEvent.ACTION_DOWN: onActionDown(event); break; case MotionEvent.ACTION_UP: isEventConsumed = onActionUp(event); break; case MotionEvent.ACTION_MOVE: onActionMove(event); break; default: break; } return isEventConsumed; } Swipe();  Swipe(int swipingThreshold, int swipedThreshold); void setListener(SwipeListener swipeListener); Observable<SwipeEvent> observe(); boolean dispatchTouchEvent(final MotionEvent event); int getSwipingThreshold(); int getSwipedThreshold(); }
Swipe { public boolean dispatchTouchEvent(final MotionEvent event) { checkNotNull(event, "event == null"); boolean isEventConsumed = false; switch (event.getAction()) { case MotionEvent.ACTION_DOWN: onActionDown(event); break; case MotionEvent.ACTION_UP: isEventConsumed = onActionUp(event); break; case MotionEvent.ACTION_MOVE: onActionMove(event); break; default: break; } return isEventConsumed; } Swipe();  Swipe(int swipingThreshold, int swipedThreshold); void setListener(SwipeListener swipeListener); Observable<SwipeEvent> observe(); boolean dispatchTouchEvent(final MotionEvent event); int getSwipingThreshold(); int getSwipedThreshold(); final static int DEFAULT_SWIPING_THRESHOLD; final static int DEFAULT_SWIPED_THRESHOLD; }