I have a RecyclerView
in which i have an image ,a few TextView
s and 2 ImageButton
s.
I have 7-8 such rows to display in my Activity>
This works nicely to put a maximum threshold on the fling speed:
mRecyclerView.setOnFlingListener(new RecyclerView.OnFlingListener() {
@Override
public boolean onFling(int velocityX, int velocityY) {
if (Math.abs(velocityY) > MAX_VELOCITY_Y) {
velocityY = MAX_VELOCITY_Y * (int) Math.signum((double)velocityY);
mRecyclerView.fling(velocityX, velocityY);
return true;
}
return false;
}
});