package com.bonait.bnframework.common.linktab.makegood;

import static com.bonait.bnframework.MainApplication.getContext;

import android.content.Context;
import android.content.res.Resources;

import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.helper.I.MyClickListener;
import com.bonait.bnframework.common.linktab.LinkMode;
import com.bonait.bnframework.common.view.MyLayoutManager;
import com.bonait.bnframework.modules.home.adapter.good_adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class MakeGoodRightAdapter extends BaseQuickAdapter<LinkMode, BaseViewHolder> {

    public List<LinkMode> Fdata;
    public Resources resources;
    public MyClickListener mListener = null;
    public Context context;

    public MakeGoodRightAdapter(@LayoutRes int layoutResId, @Nullable List<LinkMode> data, Resources _resources, MyClickListener _mListener,Context c) {
        super(layoutResId, data);
        resources=_resources;
        Fdata=data;
        mListener=_mListener;
        context=c;
    }

    @Override
    protected void convert(BaseViewHolder holder, LinkMode item) {
        RecyclerView view= holder.getView(R.id.recycler_view);
        MyLayoutManager layout = new MyLayoutManager();
        layout.setAutoMeasureEnabled(true);
        view.setLayoutManager(layout);
        good_adapter adapter = new good_adapter(context, item.content,mListener);
        view.setAdapter(adapter);
    }
}