package io.apptik.widget.multiview.scrollers;


import android.content.Context;
import android.graphics.PointF;
import android.support.v7.widget.RecyclerView;

public abstract class FlexiSmoothScroller extends BaseSmoothScroller {

    public FlexiSmoothScroller(Context context) {
        super(context);
    }

    @Override
    public PointF computeScrollVectorForPosition(int targetPosition) {
        RecyclerView.LayoutManager lm = getLayoutManager();
        if (getChildCount() == 0) {
            return null;
        }
        final int firstChildPos = lm.getPosition(lm.getChildAt(0));
        final int direction = targetPosition < firstChildPos != false ? -1 : 1;

        return new PointF(direction, 0);
    }
}

@@ -234,74 +234,910 @@
    p
-ublic FlexiSmoothScroller(Context context) %7B%0A        super(context
+rivate Runnable beforeScrollAction;%0A    private Runnable afterScrollAction;%0A%0A    public FlexiSmoothScroller(Context context) %7B%0A        super(context);%0A    %7D%0A%0A    public Runnable getAfterScrollAction() %7B%0A        return afterScrollAction;%0A    %7D%0A%0A    public void setAfterScrollAction(Runnable afterScrollAction) %7B%0A        this.afterScrollAction = afterScrollAction;%0A    %7D%0A%0A    public Runnable getBeforeScrollAction() %7B%0A        return beforeScrollAction;%0A    %7D%0A%0A    public void setBeforeScrollAction(Runnable beforeScrollAction) %7B%0A        this.beforeScrollAction = beforeScrollAction;%0A    %7D%0A%0A    @Override%0A    protected void onStop() %7B%0A        if(afterScrollAction!=null) %7B%0A            afterScrollAction.run();%0A        %7D%0A        super.onStop();%0A    %7D%0A%0A    @Override%0A    protected void onStart() %7B%0A        if(beforeScrollAction!=null) %7B%0A            beforeScrollAction.run();%0A        %7D%0A        super.onStart(
 );%0A 

add scroller before after action