Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ public class OnScrollDispatchHelper {

private long mLastScrollEventTimeMs = -(MIN_EVENT_SEPARATION_MS + 1);

private static final float THRESHOLD = 0.1f; // Threshold for end fling

/**
* Call from a ScrollView in onScrollChanged, returns true if this onScrollChanged is legit (not a
* duplicate) and should be dispatched.
Expand All @@ -40,11 +38,6 @@ public boolean onScrollChanged(int x, int y) {
mPrevX != x ||
mPrevY != y;

// Skip the first calculation in each scroll
if (Math.abs(mXFlingVelocity) < THRESHOLD && Math.abs(mYFlingVelocity) < THRESHOLD) {
shouldDispatch = false;
}

if (eventTime - mLastScrollEventTimeMs != 0) {
mXFlingVelocity = (float) (x - mPrevX) / (eventTime - mLastScrollEventTimeMs);
mYFlingVelocity = (float) (y - mPrevY) / (eventTime - mLastScrollEventTimeMs);
Expand Down