WrapContentLinearLayoutManager.java 1.12 KB
Newer Older
1
package com.ydl.ydlcommon.view;
konghaorui committed
2 3

import android.content.Context;
YKai committed
4 5
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
konghaorui committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
import android.util.AttributeSet;
import android.util.Log;

/**
 * Created by xiongyu on 2017/4/17.
 */

public class WrapContentLinearLayoutManager extends LinearLayoutManager{
    public WrapContentLinearLayoutManager(Context context) {
        super(context);
    }

    public WrapContentLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
        super(context, orientation, reverseLayout);
    }

    public WrapContentLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
        try {
            super.onLayoutChildren(recycler, state);
        } catch (IndexOutOfBoundsException e) {
            Log.e("xyutest", "RecyclerView问题=WrapContentLinearLayoutManager=meet a IOOBE in RecyclerView==e==》"+e);
        }
    }
}