diff options
| author | Adam Powell <adamp@google.com> | 2010-10-02 17:16:30 -0700 |
|---|---|---|
| committer | Adam Powell <adamp@google.com> | 2010-10-04 15:06:30 -0700 |
| commit | 62a744e17d32fed0208ad874392e68adc71b601e (patch) | |
| tree | fbd1d8ce72c21e7378f0f425f722c31dc4b0b8d6 /core/java | |
| parent | d29e6861717a4e762050eb5a30169729e205d651 (diff) | |
Fix bug 3052686 - ScrollView padding treated incorrectly
Also allow grabbing scrollviews for dragging outside of content
bounds, which makes a difference for overscroll effects.
Change-Id: I344db4490ad59f393bb6de338009e251a76e6282
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/widget/HorizontalScrollView.java | 6 | ||||
| -rw-r--r-- | core/java/android/widget/ScrollView.java | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/core/java/android/widget/HorizontalScrollView.java b/core/java/android/widget/HorizontalScrollView.java index 0bb97dd359af..cd10a59991a4 100644 --- a/core/java/android/widget/HorizontalScrollView.java +++ b/core/java/android/widget/HorizontalScrollView.java @@ -503,9 +503,7 @@ public class HorizontalScrollView extends FrameLayout { switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: { final float x = ev.getX(); - if (!(mIsBeingDragged = inChild((int) x, (int) ev.getY()))) { - return false; - } + mIsBeingDragged = true; /* * If being flinged and user touches, stop the fling. isFinished @@ -642,7 +640,7 @@ public class HorizontalScrollView extends FrameLayout { if (getChildCount() > 0) { View child = getChildAt(0); scrollRange = Math.max(0, - child.getWidth() - getWidth() - mPaddingLeft - mPaddingRight); + child.getWidth() - (getWidth() - mPaddingLeft - mPaddingRight)); } return scrollRange; } diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java index 2ba1c4791705..8472d9ce5e71 100644 --- a/core/java/android/widget/ScrollView.java +++ b/core/java/android/widget/ScrollView.java @@ -498,9 +498,7 @@ public class ScrollView extends FrameLayout { switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: { final float y = ev.getY(); - if (!(mIsBeingDragged = inChild((int) ev.getX(), (int) y))) { - return false; - } + mIsBeingDragged = true; /* * If being flinged and user touches, stop the fling. isFinished @@ -637,7 +635,7 @@ public class ScrollView extends FrameLayout { if (getChildCount() > 0) { View child = getChildAt(0); scrollRange = Math.max(0, - child.getHeight() - getHeight() - mPaddingBottom - mPaddingTop); + child.getHeight() - (getHeight() - mPaddingBottom - mPaddingTop)); } return scrollRange; } |
