Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0c71eb9 authored by Jeff Brown's avatar Jeff Brown
Browse files

Can't stop the fling!

Bug: 5335420

Fixed a bug in VelocityTracker where the output velocity was
not being set to zero when not available.

Added a condition to ensure that the velocity is at least
the minimum fling velocity before continuing.  If not, then
the user is trying to stop the fling and scroll more precisely.

Change-Id: I36634b0c3f7a9a09cf20c33f71d41163a8e33eed
parent 1afeea0f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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 {
+2 −0
Original line number Diff line number Diff line
@@ -1020,6 +1020,8 @@ bool VelocityTracker::getVelocity(uint32_t id, float* outVx, float* outVy) const
            return true;
        }
    }
    *outVx = 0;
    *outVy = 0;
    return false;
}

+1 −1

File changed.

Contains only whitespace changes.