File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
lib/java/com/google/android/material/bottomsheet Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,8 @@ void onLayout(@NonNull View bottomSheet) {}
215215
216216 private static final int VIEW_INDEX_BOTTOM_SHEET = 0 ;
217217
218+ private static final int INVALID_POSITION = -1 ;
219+
218220 @ VisibleForTesting
219221 static final int VIEW_INDEX_ACCESSIBILITY_DELEGATE_VIEW = 1 ;
220222
@@ -319,7 +321,7 @@ void onLayout(@NonNull View bottomSheet) {}
319321
320322 int activePointerId ;
321323
322- private int initialY ;
324+ private int initialY = INVALID_POSITION ;
323325
324326 boolean touchingScrollingChild ;
325327
@@ -653,6 +655,7 @@ public boolean onInterceptTouchEvent(
653655 && state != STATE_DRAGGING
654656 && !parent .isPointInChildBounds (scroll , (int ) event .getX (), (int ) event .getY ())
655657 && viewDragHelper != null
658+ && initialY != INVALID_POSITION
656659 && Math .abs (initialY - event .getY ()) > viewDragHelper .getTouchSlop ();
657660 }
658661
@@ -1460,6 +1463,7 @@ private float calculateSlideOffsetWithTop(int top) {
14601463
14611464 private void reset () {
14621465 activePointerId = ViewDragHelper .INVALID_POINTER ;
1466+ initialY = INVALID_POSITION ;
14631467 if (velocityTracker != null ) {
14641468 velocityTracker .recycle ();
14651469 velocityTracker = null ;
You can’t perform that action at this time.
0 commit comments