Smooth scroll recyclerview android
<p>I have a <code>Recyclerview</code> which contains <code>ratingbar</code> in <code>list_items.xml</code></p>

<p>on completion of the rating of one item in <code>Recyclerview</code> I scroll to another item of <code>Recyclerview</code> automatically</p>

<p>The scrolling is very fast , user couldn't know that it is scrolled.</p>

<p>I implemented smooth scroll , but not working properly, 
<strong>first scroll of 2nd item is smooth (1st is already displayed ), but other items scroll is fast</strong></p>

<p>LinearLayoutSmoothScroll.java</p>

<pre><code>public class LinearLayoutSmoothScroll extends LinearLayoutManager {
        private static final float MILLISECONDS_PER_INCH = 100f;
        private Context mContext;

        public LinearLayoutSmoothScroll(Context context) {
                super(context);
                mContext=context;
        }

        public LinearLayoutSmoothScroll(Context context, int orientation, boolean reverseLayout) {
                super(context, orientation, reverseLayout);
                mContext=context;
        }

        public LinearLayoutSmoothScroll(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
                super(context, attrs, defStyleAttr, defStyleRes);
                mContext=context;
        }
        @Override
        public void smoothScrollToPosition(RecyclerView recyclerView,
                                           RecyclerView.State state, final int position) {

                LinearSmoothScroller smoothScroller =
                        new LinearSmoothScroller(mContext) {

                                //This controls the direction in which smoothScroll looks
                                //for your view
                                @Override
                                public PointF computeScrollVectorForPosition
                                (int targetPosition) {
                                        return LinearLayoutSmoothScroll.this
                                                .computeScrollVectorForPosition(targetPosition);
                                }

                                //This returns the milliseconds it takes to
                                //scroll one pixel.
                                @Override
                                protected float calculateSpeedPerPixel
                                (DisplayMetrics displayMetrics) {
                                        return MILLISECONDS_PER_INCH/displayMetrics.densityDpi;
                                }
                        };

                smoothScroller.setTargetPosition(position);
                startSmoothScroll(smoothScroller);
        }
}
</code></pre>

<p>usage :</p>

<pre><code>layoutManager.smoothScrollToPosition(rvSurvey,new RecyclerView.State(),new_position);
</code></pre>