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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user