From 0f27be7f4391335cb9b3b999b44599dec45ebee6 Mon Sep 17 00:00:00 2001 From: Jin Park Date: Tue, 20 Aug 2013 21:34:26 +0900 Subject: [PATCH] fixed : tap to stop flinging not working --- .../library/views/StaggeredGridView.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/com/origamilabs/library/views/StaggeredGridView.java b/src/com/origamilabs/library/views/StaggeredGridView.java index 7338d85..70239d7 100644 --- a/src/com/origamilabs/library/views/StaggeredGridView.java +++ b/src/com/origamilabs/library/views/StaggeredGridView.java @@ -456,7 +456,7 @@ public boolean onTouchEvent(MotionEvent ev) { mActivePointerId = MotionEventCompat.getPointerId(ev, 0); mTouchRemainderY = 0; - if(mTouchMode != TOUCH_MODE_FLINGING && !mDataChanged && motionPosition >= 0 && getAdapter().isEnabled(motionPosition)){ + if(mTouchMode != TOUCH_MODE_DRAGGING && mTouchMode != TOUCH_MODE_FLINGING && !mDataChanged && motionPosition >= 0 && getAdapter().isEnabled(motionPosition)){ mTouchMode = TOUCH_MODE_DOWN; mBeginClick = true; @@ -536,14 +536,12 @@ public boolean onTouchEvent(MotionEvent ev) { mLastTouchY = 0; invalidate(); } else { - mTouchMode = TOUCH_MODE_IDLE; - } - - if (!mDataChanged && mAdapter.isEnabled(motionPosition)) { - // TODO : handle - mTouchMode = TOUCH_MODE_TAP; - } else { - mTouchMode = TOUCH_MODE_REST; + if (!mDataChanged && mAdapter.isEnabled(motionPosition)) { + // TODO : handle + mTouchMode = TOUCH_MODE_TAP; + } else { + mTouchMode = TOUCH_MODE_REST; + } } switch(prevTouchMode){