summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2010-12-04 04:07:12 +0000
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2010-12-04 04:07:12 +0000
commit1fbd42e5e81e6ec9faa2ca0067ae7e3b9727db6a (patch)
treedc48fa6c54ace17db81448dce21b952038fd59f0
parent25eee5c4ef1f3e3126363f2a101af4f9237170bc (diff)
parent34f354cf66dd4e777422019ae77346b02440b59d (diff)
downloadframeworks_base-1fbd42e5e81e6ec9faa2ca0067ae7e3b9727db6a.zip
frameworks_base-1fbd42e5e81e6ec9faa2ca0067ae7e3b9727db6a.tar.gz
frameworks_base-1fbd42e5e81e6ec9faa2ca0067ae7e3b9727db6a.tar.bz2
Merge "Make sure overscroll isn't applied in views it shouldn't be" into froyo
-rw-r--r--core/java/android/widget/AbsListView.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 39d2387..f52e00b 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -1967,7 +1967,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
// Check if we have moved far enough that it looks more like a
// scroll than a tap
final int distance = Math.abs(deltaY);
- final boolean overscroll = mScrollY != 0;
+ final boolean overscroll = mScrollY != 0 && (getOverscrollMode() != OVERSCROLL_NEVER);
if (overscroll || distance > mTouchSlop) {
createScrollingCache();
mTouchMode = overscroll ? TOUCH_MODE_OVERSCROLL : TOUCH_MODE_SCROLL;
@@ -2147,15 +2147,17 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
int motionPosition = findMotionRow(y);
if (motionPosition >= 0) {
final View motionView = getChildAt(motionPosition - mFirstPosition);
- // Apply overscroll
- final int motionViewRealTop = motionView.getTop();
-
- int overscroll = -incrementalDeltaY -
+ if (getOverscrollMode() != OVERSCROLL_NEVER) {
+ // Apply overscroll
+ final int motionViewRealTop = motionView.getTop();
+
+ int overscroll = -incrementalDeltaY -
(motionViewRealTop - mMotionViewOriginalTop);
- overscrollBy(0, overscroll, 0, mScrollY, 0, 0,
- 0, getOverscrollMax(), true);
- mTouchMode = TOUCH_MODE_OVERSCROLL;
- invalidate();
+ overscrollBy(0, overscroll, 0, mScrollY, 0, 0,
+ 0, getOverscrollMax(), true);
+ mTouchMode = TOUCH_MODE_OVERSCROLL;
+ invalidate();
+ }
mMotionViewOriginalTop = motionView.getTop();
}
mMotionY = y;