Skip to content

Commit 79aa403

Browse files
Jeff BrownAndroid (Google) Code Review
authored andcommitted
Merge "Can't stop the fling! Bug: 5335420" into ics-factoryrom
2 parents 259db3f + b0c71eb commit 79aa403

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

core/java/android/widget/AbsListView.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3654,7 +3654,8 @@ public void run() {
36543654
vt.computeCurrentVelocity(1000, mMaximumVelocity);
36553655
final float yvel = -vt.getYVelocity(activeId);
36563656

3657-
if (scroller.isScrollingInDirection(0, yvel)) {
3657+
if (Math.abs(yvel) >= mMinimumVelocity
3658+
&& scroller.isScrollingInDirection(0, yvel)) {
36583659
// Keep the fling alive a little longer
36593660
postDelayed(this, FLYWHEEL_TIMEOUT);
36603661
} else {

core/java/android/widget/OverScroller.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ public boolean isScrollingInDirection(float xvel, float yvel) {
532532
final int dx = mScrollerX.mFinal - mScrollerX.mStart;
533533
final int dy = mScrollerY.mFinal - mScrollerY.mStart;
534534
return !isFinished() && Math.signum(xvel) == Math.signum(dx) &&
535-
Math.signum(yvel) == Math.signum(dy);
535+
Math.signum(yvel) == Math.signum(dy);
536536
}
537537

538538
static class SplineOverScroller {

libs/ui/Input.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,8 @@ bool VelocityTracker::getVelocity(uint32_t id, float* outVx, float* outVy) const
10201020
return true;
10211021
}
10221022
}
1023+
*outVx = 0;
1024+
*outVy = 0;
10231025
return false;
10241026
}
10251027

0 commit comments

Comments
 (0)