am 7bfc9795: Clamping maximum overscroll amount

* commit '7bfc979594b083c36f6a08e49273ef7c9ad7b13a':
  Clamping maximum overscroll amount
This commit is contained in:
Adam Cohen
2011-01-28 14:03:18 -08:00
committed by Android Git Automerger
+5
View File
@@ -879,6 +879,11 @@ public abstract class PagedView extends ViewGroup {
if (f == 0) return;
f = f / (Math.abs(f)) * (overScrollInfluenceCurve(Math.abs(f)));
// Clamp this factor, f, to -1 < f < 1
if (Math.abs(f) >= 1) {
f /= Math.abs(f);
}
int overScrollAmount = (int) Math.round(OVERSCROLL_DAMP_FACTOR * f * screenSize);
if (amount < 0) {
mScrollX = overScrollAmount;