package com.xty.common.weight;

import android.content.Context;
import android.util.AttributeSet;

import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;

public class ExpandStaggeredManager extends StaggeredGridLayoutManager {
    public ExpandStaggeredManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }



    public ExpandStaggeredManager(int spanCount, int orientation) {
        super(spanCount, orientation);
    }

    @Override
    public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
        try {
            super.onLayoutChildren(recycler, state);
        }catch (Exception e){
            e.printStackTrace();
        }

    }

    /**
     * 通过 try catch 捕捉错误
     * @param state
     */
    @Override
    public void onScrollStateChanged(int state) {
        try {
            super.onScrollStateChanged(state);
        }catch (Exception e){
            e.printStackTrace();
        }

    }

}
