Programmatically scroll RecyclerView vertically
<p>I want to programmatically scroll a <code>RecyclerView</code>, is it possible to do something like this? </p>

<p>I have the following code in a custom <code>RecyclerView</code> in order to dispatch a scrolling event, but I am stuck in figuring out a mock <code>MotionEvent</code>:</p>

<pre><code>public boolean dispatchHandlerScroll(MotionEvent e) {
    switch (e.getAction()) {
        case MotionEvent.ACTION_DOWN: {
            y = (int) e.getY();
            startNestedScroll(2);
            break;
        }
        case MotionEvent.ACTION_MOVE: {
            int dY = y - ((int) e.getY());
            dispatchNestedPreScroll(0, dY, null, null);
            dispatchNestedScroll(0, 0, 0, dY, null);
            break;
        }
        case MotionEvent.ACTION_UP: {
            stopNestedScroll();
            break;
        }
    }
    return true;
}
</code></pre>

<p>Anyone have an idea?</p>