Skip to content

Commit

Permalink
fix-click-touch
Browse files Browse the repository at this point in the history
  • Loading branch information
yangyufei committed Nov 8, 2018
1 parent c9de6a9 commit 55cc63a
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,13 @@ public boolean onTouchEvent(MotionEvent event) {

if (!isHoldTouch && isChildCanScroll(event, deltaY)) {
setSheetTranslation(maxSheetTranslation);
MotionEvent downEvent = MotionEvent.obtain(event);
downEvent.setAction(MotionEvent.ACTION_DOWN);
getChildAt(0).dispatchTouchEvent(downEvent);
downEvent.recycle();
isHoldTouch = true;
if (!(event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL)) {
MotionEvent downEvent = MotionEvent.obtain(event);
downEvent.setAction(MotionEvent.ACTION_DOWN);
getChildAt(0).dispatchTouchEvent(downEvent);
downEvent.recycle();
}
}

if (isHoldTouch) {
Expand Down

0 comments on commit 55cc63a

Please sign in to comment.