@@ -0,0 +1,1965 @@
+package com.leochuan;%0A%0Aimport android.support.v7.widget.RecyclerView;%0A%0A/**%0A * Used by %7B@link AutoPlayRecyclerView%7D to implement auto play effect%0A */%0A%0Apublic class PageSnapHelper extends CenterSnapHelper %7B%0A%0A    @Override%0A    public boolean onFling(int velocityX, int velocityY) %7B%0A        ViewPagerLayoutManager layoutManager = (ViewPagerLayoutManager) mRecyclerView.getLayoutManager();%0A        if (layoutManager == null) %7B%0A            return false;%0A        %7D%0A        RecyclerView.Adapter adapter = mRecyclerView.getAdapter();%0A        if (adapter == null) %7B%0A            return false;%0A        %7D%0A%0A        final int minFlingVelocity = mRecyclerView.getMinFlingVelocity();%0A        mGravityScroller.fling(0, 0, velocityX, velocityY,%0A                Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE);%0A%0A        if (layoutManager.mOrientation == ViewPagerLayoutManager.VERTICAL%0A                && Math.abs(velocityY) %3E minFlingVelocity) %7B%0A            final int currentPosition = layoutManager.getCurrentPosition();%0A            final int offsetPosition = mGravityScroller.getFinalY() * layoutManager.getDistanceRatio() %3E layoutManager.mInterval ? 1 : 0;%0A            mRecyclerView.smoothScrollToPosition(layoutManager.getReverseLayout() ?%0A                    currentPosition - offsetPosition : currentPosition + offsetPosition);%0A            return true;%0A        %7D else if (layoutManager.mOrientation == ViewPagerLayoutManager.HORIZONTAL%0A                && Math.abs(velocityX) %3E minFlingVelocity) %7B%0A            final int currentPosition = layoutManager.getCurrentPosition();%0A            final int offsetPosition = mGravityScroller.getFinalX() * layoutManager.getDistanceRatio() %3E layoutManager.mInterval ? 1 : 0;%0A            mRecyclerView.smoothScrollToPosition(layoutManager.getReverseLayout() ?%0A                    currentPosition - offsetPosition : currentPosition + offsetPosition);%0A            return true;%0A        %7D%0A%0A        return true;%0A    %7D%0A%7D%0A

add PageSnapHelper