package com.gingersoft.gsa.cloud.main.mvp.ui.adapter;

import android.widget.TextView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.database.bean.Function;
import com.gingersoft.gsa.cloud.main.R;

import java.util.List;

/**
 * Created by Wyh on 2020/2/19.
 * 首頁點餐
 */
public class MainOrderingAdapter extends BaseQuickAdapter<Function, BaseViewHolder> {

    public MainOrderingAdapter(int layoutResId, @Nullable List<Function> data) {
        super(layoutResId, data);
    }

//    public MainOrderingAdapter(@Nullable List<SectionItem> data) {
//        super(R.layout.main_home_funcation_item, data);
//    }

    @Override
    protected void convert(BaseViewHolder helper, Function item) {
        helper.setImageResource(R.id.iv_main_home_item_function_icon, item.getIcRes());
        helper.setText(R.id.tv_main_home_item_function_name, item.getResName());
        TextView textView = helper.getView(R.id.tv_main_home_item_function_name);
        textView.setSelected(true);
    }
}
