Merge "Can't stop the fling! Bug: 5335420" into ics-factoryrom

This commit is contained in:
Jeff Brown
2011-09-16 23:29:15 -07:00
committed by Android (Google) Code Review
3 changed files with 5 additions and 2 deletions

View File

@ -3654,7 +3654,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
vt.computeCurrentVelocity(1000, mMaximumVelocity);
final float yvel = -vt.getYVelocity(activeId);
if (scroller.isScrollingInDirection(0, yvel)) {
if (Math.abs(yvel) >= mMinimumVelocity
&& scroller.isScrollingInDirection(0, yvel)) {
// Keep the fling alive a little longer
postDelayed(this, FLYWHEEL_TIMEOUT);
} else {

View File

@ -532,7 +532,7 @@ public class OverScroller {
final int dx = mScrollerX.mFinal - mScrollerX.mStart;
final int dy = mScrollerY.mFinal - mScrollerY.mStart;
return !isFinished() && Math.signum(xvel) == Math.signum(dx) &&
Math.signum(yvel) == Math.signum(dy);
Math.signum(yvel) == Math.signum(dy);
}
static class SplineOverScroller {

View File

@ -1020,6 +1020,8 @@ bool VelocityTracker::getVelocity(uint32_t id, float* outVx, float* outVy) const
return true;
}
}
*outVx = 0;
*outVy = 0;
return false;
}