DO NOT MERGE Only show edge glow effect on 1 side at a time.

Pulling on a side should force the opposite side into "decay".
Fixes b/3061753  new list "bounce" shouldn't show on both ends

Change-Id: I4742e8c212f8e13da29ed887ebdd712903b533f7
This commit is contained in:
Mindy Pereira
2010-10-07 14:03:45 -07:00
parent 4a962a06db
commit ca6eb210e6

View File

@@ -2247,8 +2247,14 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
mTouchMode = TOUCH_MODE_OVERSCROLL;
if (rawDeltaY > 0) {
mEdgeGlowTop.onPull((float) overscroll / getHeight());
if (!mEdgeGlowBottom.isFinished()) {
mEdgeGlowBottom.onRelease();
}
} else if (rawDeltaY < 0) {
mEdgeGlowBottom.onPull((float) overscroll / getHeight());
if (!mEdgeGlowTop.isFinished()) {
mEdgeGlowTop.onRelease();
}
}
}
}
@@ -2307,8 +2313,14 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
!contentFits())) {
if (rawDeltaY > 0) {
mEdgeGlowTop.onPull((float) -incrementalDeltaY / getHeight());
if (!mEdgeGlowBottom.isFinished()) {
mEdgeGlowBottom.onRelease();
}
} else if (rawDeltaY < 0) {
mEdgeGlowBottom.onPull((float) -incrementalDeltaY / getHeight());
if (!mEdgeGlowTop.isFinished()) {
mEdgeGlowTop.onRelease();
}
}
invalidate();
}