Loading core/java/android/widget/AbsListView.java +14 −2 Original line number Diff line number Diff line Loading @@ -567,6 +567,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te private Runnable mClearScrollingCache; private int mMinimumVelocity; private int mMaximumVelocity; private int mDecacheThreshold; private float mVelocityScale = 1.0f; final boolean[] mIsScrap = new boolean[1]; Loading Loading @@ -786,6 +787,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mTouchSlop = configuration.getScaledTouchSlop(); mMinimumVelocity = configuration.getScaledMinimumFlingVelocity(); mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); mDecacheThreshold = mMaximumVelocity / 2; mOverscrollDistance = configuration.getScaledOverscrollDistance(); mOverflingDistance = configuration.getScaledOverflingDistance(); Loading Loading @@ -3650,7 +3652,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te // Keep the fling alive a little longer postDelayed(this, FLYWHEEL_TIMEOUT); } else { endFling(); endFling(false); // Don't disable the scrolling cache right after it was enabled mTouchMode = TOUCH_MODE_SCROLL; reportScrollStateChange(OnScrollListener.SCROLL_STATE_TOUCH_SCROLL); } Loading @@ -3664,6 +3666,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } void start(int initialVelocity) { if (Math.abs(initialVelocity) > mDecacheThreshold) { // For long flings, scrolling cache causes stutter, so don't use it clearScrollingCache(); } int initialY = initialVelocity < 0 ? Integer.MAX_VALUE : 0; mLastFlingY = initialY; mScroller.fling(0, initialY, 0, initialVelocity, Loading Loading @@ -3733,12 +3740,17 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } void endFling() { endFling(true); } void endFling(boolean clearCache) { mTouchMode = TOUCH_MODE_REST; removeCallbacks(this); removeCallbacks(mCheckFlywheel); reportScrollStateChange(OnScrollListener.SCROLL_STATE_IDLE); if (clearCache) clearScrollingCache(); mScroller.abortAnimation(); Loading Loading
core/java/android/widget/AbsListView.java +14 −2 Original line number Diff line number Diff line Loading @@ -567,6 +567,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te private Runnable mClearScrollingCache; private int mMinimumVelocity; private int mMaximumVelocity; private int mDecacheThreshold; private float mVelocityScale = 1.0f; final boolean[] mIsScrap = new boolean[1]; Loading Loading @@ -786,6 +787,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mTouchSlop = configuration.getScaledTouchSlop(); mMinimumVelocity = configuration.getScaledMinimumFlingVelocity(); mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); mDecacheThreshold = mMaximumVelocity / 2; mOverscrollDistance = configuration.getScaledOverscrollDistance(); mOverflingDistance = configuration.getScaledOverflingDistance(); Loading Loading @@ -3650,7 +3652,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te // Keep the fling alive a little longer postDelayed(this, FLYWHEEL_TIMEOUT); } else { endFling(); endFling(false); // Don't disable the scrolling cache right after it was enabled mTouchMode = TOUCH_MODE_SCROLL; reportScrollStateChange(OnScrollListener.SCROLL_STATE_TOUCH_SCROLL); } Loading @@ -3664,6 +3666,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } void start(int initialVelocity) { if (Math.abs(initialVelocity) > mDecacheThreshold) { // For long flings, scrolling cache causes stutter, so don't use it clearScrollingCache(); } int initialY = initialVelocity < 0 ? Integer.MAX_VALUE : 0; mLastFlingY = initialY; mScroller.fling(0, initialY, 0, initialVelocity, Loading Loading @@ -3733,12 +3740,17 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } void endFling() { endFling(true); } void endFling(boolean clearCache) { mTouchMode = TOUCH_MODE_REST; removeCallbacks(this); removeCallbacks(mCheckFlywheel); reportScrollStateChange(OnScrollListener.SCROLL_STATE_IDLE); if (clearCache) clearScrollingCache(); mScroller.abortAnimation(); Loading