Skip to content

Commit 0278c2f

Browse files
committed
Don't let ScrollView intercept touch events if it can't scroll.
Bug 6872104 Change-Id: Iee643e052acc37485a8ec45b7af8be0783fb1a95
1 parent 9dcfff2 commit 0278c2f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

core/java/android/widget/ScrollView.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,13 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
460460
return true;
461461
}
462462

463+
/*
464+
* Don't try to intercept touch if we can't scroll anyway.
465+
*/
466+
if (getScrollY() == 0 && !canScrollVertically(1)) {
467+
return false;
468+
}
469+
463470
switch (action & MotionEvent.ACTION_MASK) {
464471
case MotionEvent.ACTION_MOVE: {
465472
/*

0 commit comments

Comments
 (0)