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
This fixes scroller and horizontalscroller.

Change-Id: I4d9820c7178378b793ed9a29b119943eb1f46587
This commit is contained in:
Mindy Pereira
2010-10-07 14:29:03 -07:00
parent a1bf0a06b2
commit 4de94de9c5
2 changed files with 12 additions and 0 deletions

View File

@@ -542,8 +542,14 @@ public class HorizontalScrollView extends FrameLayout {
final int pulledToX = oldX + deltaX;
if (pulledToX < 0) {
mEdgeGlowLeft.onPull((float) deltaX / getWidth());
if (!mEdgeGlowRight.isFinished()) {
mEdgeGlowRight.onRelease();
}
} else if (pulledToX > range) {
mEdgeGlowRight.onPull((float) deltaX / getWidth());
if (!mEdgeGlowLeft.isFinished()) {
mEdgeGlowLeft.onRelease();
}
}
}
}

View File

@@ -537,8 +537,14 @@ public class ScrollView extends FrameLayout {
final int pulledToY = oldY + deltaY;
if (pulledToY < 0) {
mEdgeGlowTop.onPull((float) deltaY / getHeight());
if (!mEdgeGlowBottom.isFinished()) {
mEdgeGlowBottom.onRelease();
}
} else if (pulledToY > range) {
mEdgeGlowBottom.onPull((float) deltaY / getHeight());
if (!mEdgeGlowTop.isFinished()) {
mEdgeGlowTop.onRelease();
}
}
}
}