DO NOT MERGE. Only 1 edge glow should be growing at a time.

When a user action starts a new edge glow (on pull or absorb), cause
the edge glow on the opposite side to decay.
Fixes b/ star  3028395  Yellow color bar is displayed when user reaches the end of the message and keeps scrolling in Gmail.

Change-Id: Id06e00d1843b0467f6f9149c22b233e639fc55ac
This commit is contained in:
Mindy Pereira
2010-09-26 17:26:17 -07:00
parent 89647b1172
commit 7d4995d250

View File

@@ -2950,16 +2950,28 @@ public class WebView extends AbsoluteLayout
if (rangeY > 0 || getOverscrollMode() == OVERSCROLL_ALWAYS) {
if (y < 0 && oldY >= 0) {
mEdgeGlowTop.onAbsorb((int) mScroller.getCurrVelocity());
if (!mEdgeGlowBottom.isFinished()) {
mEdgeGlowBottom.onRelease();
}
} else if (y > rangeY && oldY <= rangeY) {
mEdgeGlowBottom.onAbsorb((int) mScroller.getCurrVelocity());
if (!mEdgeGlowTop.isFinished()) {
mEdgeGlowTop.onRelease();
}
}
}
if (rangeX > 0) {
if (x < 0 && oldX >= 0) {
mEdgeGlowLeft.onAbsorb((int) mScroller.getCurrVelocity());
if (!mEdgeGlowRight.isFinished()) {
mEdgeGlowRight.onRelease();
}
} else if (x > rangeX && oldX <= rangeX) {
mEdgeGlowRight.onAbsorb((int) mScroller.getCurrVelocity());
if (!mEdgeGlowLeft.isFinished()) {
mEdgeGlowLeft.onRelease();
}
}
}
}
@@ -5548,8 +5560,14 @@ public class WebView extends AbsoluteLayout
final int pulledToX = oldX + deltaX;
if (pulledToX < 0) {
mEdgeGlowLeft.onPull((float) deltaX / getWidth());
if (!mEdgeGlowRight.isFinished()) {
mEdgeGlowRight.onRelease();
}
} else if (pulledToX > rangeX) {
mEdgeGlowRight.onPull((float) deltaX / getWidth());
if (!mEdgeGlowLeft.isFinished()) {
mEdgeGlowLeft.onRelease();
}
}
}
@@ -5557,8 +5575,14 @@ public class WebView extends AbsoluteLayout
final int pulledToY = oldY + deltaY;
if (pulledToY < 0) {
mEdgeGlowTop.onPull((float) deltaY / getHeight());
if (!mEdgeGlowBottom.isFinished()) {
mEdgeGlowBottom.onRelease();
}
} else if (pulledToY > rangeY) {
mEdgeGlowBottom.onPull((float) deltaY / getHeight());
if (!mEdgeGlowTop.isFinished()) {
mEdgeGlowTop.onRelease();
}
}
}
}