diff options
Diffstat (limited to 'core/java/android/widget/HorizontalScrollView.java')
-rw-r--r-- | core/java/android/widget/HorizontalScrollView.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/java/android/widget/HorizontalScrollView.java b/core/java/android/widget/HorizontalScrollView.java index fee3455..db54a0d 100644 --- a/core/java/android/widget/HorizontalScrollView.java +++ b/core/java/android/widget/HorizontalScrollView.java @@ -502,8 +502,10 @@ public class HorizontalScrollView extends FrameLayout { switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: { - final float x = ev.getX(); - mIsBeingDragged = true; + mIsBeingDragged = getChildCount() != 0; + if (!mIsBeingDragged) { + return false; + } /* * If being flinged and user touches, stop the fling. isFinished @@ -514,7 +516,7 @@ public class HorizontalScrollView extends FrameLayout { } // Remember where the motion event started - mLastMotionX = x; + mLastMotionX = ev.getX(); mActivePointerId = ev.getPointerId(0); break; } |