Skip to content

Commit

Permalink
fixbug Click no response quickly
Browse files Browse the repository at this point in the history
  • Loading branch information
ChadCym committed Aug 24, 2017
1 parent 1282582 commit 4548016
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,14 @@ public void onTouchEvent(RecyclerView rv, MotionEvent e) {
public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
}

private class ItemTouchHelperGestureListener extends GestureDetector.SimpleOnGestureListener {
private class ItemTouchHelperGestureListener implements GestureDetector.OnGestureListener {

private RecyclerView recyclerView;

@Override
public boolean onDown(MotionEvent e) {
mIsPrepressed = true;
mPressedView = recyclerView.findChildViewUnder(e.getX(), e.getY());

super.onDown(e);
return false;
}

Expand All @@ -90,7 +88,6 @@ public void onShowPress(MotionEvent e) {
// mPressedView.setPressed(true);
mIsShowPress = true;
}
super.onShowPress(e);
}

ItemTouchHelperGestureListener(RecyclerView recyclerView) {
Expand Down Expand Up @@ -220,6 +217,16 @@ public void onLongPress(MotionEvent e) {
}
}
}

@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
return false;
}

@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
return false;
}
}

private void setPressViewHotSpot(final MotionEvent e, final View mPressedView) {
Expand Down

0 comments on commit 4548016

Please sign in to comment.