List of usage examples for android.widget AbsListView smoothScrollBy
public void smoothScrollBy(int distance, int duration)
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 . jav a2s . c om 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); } }