package com.tenlionsoft.baselib.core.widget.views;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.tenlionsoft.baselib.R;
import com.tenlionsoft.baselib.core.beans.FuncBean;
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;

import java.util.List;

/**
 * 功能按钮Adapter
 */
public class BaseFunctStrAdapter extends BaseRecyclerAdapter<FuncBean, BaseFunctionHolder> {
    public BaseFunctStrAdapter(Context ctx, List<FuncBean> list) {
        super(ctx, list);
    }

    @Override
    public BaseFunctionHolder createHolder(ViewGroup parent, int viewType) {
        View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_base_function, parent, false);
        return new BaseFunctionHolder(itemView);
    }

    @Override
    public void bindHolder(BaseFunctionHolder holder, int i) {
        holder.mIvButton.setImageResource(mData.get(i).getIconRes());
//        Glide.with(mContext)
//                .load(BaseUrlApi.BASE_URL + mData.get(i).getIconRes())
//                .apply(new RequestOptions()
//                        .error(R.drawable.ic_party)
//                        .placeholder(R.drawable.ic_party)
//                        .override(130)
//                        .fitCenter())
//                .into(holder.mIvButton);
//        if (!TextUtils.isEmpty(mData.get(i).getAppPhotoPath())) {
//
//        } else {
//
//        }
        holder.mTvName.setText(mData.get(i).getText());
    }
}
