Skip to content

Commit 8ab8fbb

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "Don't let ScrollView intercept touch events if it can't scroll." into jb-mr1-dev
2 parents a9fa7b2 + 0278c2f commit 8ab8fbb

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)