package com.bbitcn.silk.adapter;

import android.view.View;

import com.bbitcn.silk.base.BaseRecyclerAdapter;
import com.bbitcn.silk.databinding.ItemInfoContentBinding;
import com.bbitcn.silk.model.InfoContent;

import java.util.List;

/**
 * @Description 信息项的列表细则
 * @Author DuanKaiji
 * @CreateTime 2024年04月01日 09:30:28
 */
public class ItemContentAdapter extends BaseRecyclerAdapter<InfoContent, ItemInfoContentBinding> {

    View.OnClickListener listener;

    public ItemContentAdapter(List<InfoContent> dataList, Class<ItemInfoContentBinding> bindingClass, View.OnClickListener listener) {
        super(dataList, bindingClass);
        this.listener = listener;
    }

    @Override
    protected void bindData(ItemInfoContentBinding binding, InfoContent data) {
        binding.llRoot.setOnClickListener(listener);
        binding.tv1.setText(data.getTv1());
        binding.tv2.setText(data.getTv2());
        binding.tv3.setText(data.getTv3());
        binding.tv4.setText(data.getTv4());
    }

}
