package com.wasu.cs.widget;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.util.Log;

/**
 * Created by Danxx on 2016/6/8.
 * 中国蓝 CS 模板 行数据显示控件
 */
public class RowRecyclerView extends RecyclerView {
    public RowRecyclerView(Context context) {
        super(context);
    }

    public RowRecyclerView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public RowRecyclerView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public void scrollBy(int x, int y) {

        super.scrollBy(x + 200, y);
    }

    @Override
    public void scrollTo(int x, int y) {
        super.scrollTo(x + 200, y);
    }

    @Override
    public void smoothScrollBy(int dx, int dy) {
        if(hasFocus()){
            if(dx>0){
                int mdx = dx + 180;
                super.smoothScrollBy(mdx, dy);
            }else if(dx<0){
                int mdx= dx - 180;
                super.smoothScrollBy(mdx, dy);
            }else {
                Log.d("danxx", "FRV dy--->"+dx);
            }
        }
//        super.smoothScrollBy(dx ,dy);
    }
}
