Skip to content

Commit

Permalink
Fix picker inside scrollView
Browse files Browse the repository at this point in the history
  • Loading branch information
saravanabalagi committed Oct 25, 2019
1 parent 58d7861 commit 9c30e70
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions android/src/main/java/com/wheelpicker/LoopView.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ public boolean onTouchEvent(MotionEvent motionevent) {
switch (motionevent.getAction()) {
case MotionEvent.ACTION_DOWN:
y1 = motionevent.getRawY();
if (getParent() != null) {
getParent().requestDisallowInterceptTouchEvent(true);
}
break;
case MotionEvent.ACTION_MOVE:
y2 = motionevent.getRawY();
Expand All @@ -320,10 +323,14 @@ public boolean onTouchEvent(MotionEvent motionevent) {
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
default:
if (!gestureDetector.onTouchEvent(motionevent) && motionevent.getAction() == MotionEvent.ACTION_UP) {
smoothScroll();
}
if (getParent() != null) {
getParent().requestDisallowInterceptTouchEvent(false);
}
return true;
}

Expand Down

0 comments on commit 9c30e70

Please sign in to comment.