diff options
author | Adam Powell <adamp@google.com> | 2011-09-28 23:30:20 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2011-09-28 23:48:10 -0700 |
commit | f6a6c97062d905be267fcb8f70e6eb06fb7e5ab4 (patch) | |
tree | acdf99342996837b524dedeff54463aa652686bb /core/java | |
parent | a53d19dc6dc25e00c898fc7e53276b864ea91936 (diff) | |
download | frameworks_base-f6a6c97062d905be267fcb8f70e6eb06fb7e5ab4.zip frameworks_base-f6a6c97062d905be267fcb8f70e6eb06fb7e5ab4.tar.gz frameworks_base-f6a6c97062d905be267fcb8f70e6eb06fb7e5ab4.tar.bz2 |
Fix bug 5385274 - tabs in browser can't be scrolled
Fix a regression related to optimizing invalidation in scrolling
views.
Change-Id: I6a39075dc830d78436a274935a904a32084defac
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/widget/HorizontalScrollView.java | 12 | ||||
-rw-r--r-- | core/java/android/widget/ScrollView.java | 12 |
2 files changed, 8 insertions, 16 deletions
diff --git a/core/java/android/widget/HorizontalScrollView.java b/core/java/android/widget/HorizontalScrollView.java index 9ce8fe0..1bbc501 100644 --- a/core/java/android/widget/HorizontalScrollView.java +++ b/core/java/android/widget/HorizontalScrollView.java @@ -569,7 +569,7 @@ public class HorizontalScrollView extends FrameLayout { final boolean canOverscroll = overscrollMode == OVER_SCROLL_ALWAYS || (overscrollMode == OVER_SCROLL_IF_CONTENT_SCROLLS && range > 0); - if (canOverscroll && overScrollBy(deltaX, 0, mScrollX, 0, range, 0, + if (overScrollBy(deltaX, 0, mScrollX, 0, range, 0, mOverscrollDistance, 0, true)) { // Break our velocity if we hit a scroll barrier. mVelocityTracker.clear(); @@ -602,16 +602,12 @@ public class HorizontalScrollView extends FrameLayout { velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity); int initialVelocity = (int) velocityTracker.getXVelocity(mActivePointerId); - final int right = getScrollRange(); - final int overscrollMode = getOverScrollMode(); - final boolean canOverscroll = overscrollMode == OVER_SCROLL_ALWAYS || - (overscrollMode == OVER_SCROLL_IF_CONTENT_SCROLLS && right > 0); - - if (getChildCount() > 0 && canOverscroll) { + if (getChildCount() > 0) { if ((Math.abs(initialVelocity) > mMinimumVelocity)) { fling(-initialVelocity); } else { - if (mScroller.springBack(mScrollX, mScrollY, 0, right, 0, 0)) { + if (mScroller.springBack(mScrollX, mScrollY, 0, + getScrollRange(), 0, 0)) { invalidate(); } } diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java index d91eeb2..61ea5c9 100644 --- a/core/java/android/widget/ScrollView.java +++ b/core/java/android/widget/ScrollView.java @@ -583,7 +583,7 @@ public class ScrollView extends FrameLayout { final boolean canOverscroll = overscrollMode == OVER_SCROLL_ALWAYS || (overscrollMode == OVER_SCROLL_IF_CONTENT_SCROLLS && range > 0); - if (canOverscroll && overScrollBy(0, deltaY, 0, mScrollY, + if (overScrollBy(0, deltaY, 0, mScrollY, 0, range, 0, mOverscrollDistance, true)) { // Break our velocity if we hit a scroll barrier. mVelocityTracker.clear(); @@ -616,16 +616,12 @@ public class ScrollView extends FrameLayout { velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity); int initialVelocity = (int) velocityTracker.getYVelocity(mActivePointerId); - final int bottom = getScrollRange(); - final int overscrollMode = getOverScrollMode(); - final boolean canOverscroll = overscrollMode == OVER_SCROLL_ALWAYS || - (overscrollMode == OVER_SCROLL_IF_CONTENT_SCROLLS && bottom > 0); - - if (getChildCount() > 0 && canOverscroll) { + if (getChildCount() > 0) { if ((Math.abs(initialVelocity) > mMinimumVelocity)) { fling(-initialVelocity); } else { - if (mScroller.springBack(mScrollX, mScrollY, 0, 0, 0, bottom)) { + if (mScroller.springBack(mScrollX, mScrollY, 0, 0, 0, + getScrollRange())) { invalidate(); } } |