List of usage examples for android.widget AbsListView fling
public void fling(int velocityY)
From source file:com.czy.reecycleviewheader.ScrollableHelper.java
@SuppressLint("NewApi") public void smoothScrollBy(int velocityY, int distance, int duration) { View scrollableView = getScrollableView(); if (scrollableView instanceof AbsListView) { AbsListView absListView = (AbsListView) scrollableView; if (mSystemVersion >= 21) { absListView.fling(velocityY); } else {/*from ww w. j a va 2 s . c o m*/ absListView.smoothScrollBy(distance, duration); } } else if (scrollableView instanceof ScrollView) { ((ScrollView) scrollableView).fling(velocityY); } else if (scrollableView instanceof RecyclerView) { ((RecyclerView) scrollableView).fling(0, velocityY); } else if (scrollableView instanceof WebView) { ((WebView) scrollableView).flingScroll(0, velocityY); } }