package com.android.chmo.ui.adpater;


import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.android.chmo.R;
import com.android.chmo.base.BaseActivity;
import com.android.chmo.model.LabelInfo;


public class LabelAdapter extends CommonAdapter<LabelInfo> {
    private BaseActivity baseActivity;


    public LabelAdapter(BaseActivity activity) {
        super(activity);
        baseActivity = activity;
    }

    @Override
    public View getItemView(int position, View convertView, ViewGroup parent) {
        if(null == convertView) {
            convertView = mInflater.inflate(R.layout.list_label_item, null);
        }
        final LabelInfo item = mList.get(position);
        TextView text = (TextView) convertView;
        text.setText(item.name);
//        if(null != selectSkill && selectSkill.skillpk.equals(item.skillpk)) {
//            text.setBackgroundResource(R.mipmap.label_selected);
//            text.setTextColor(baseActivity.getResources().getColor(R.color.white));
//        }else {
//            text.setBackgroundResource(R.mipmap.label_bg);
//            text.setTextColor(baseActivity.getResources().getColor(R.color.black));
//        }
//
//        convertView.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                selectSkill = item;
//                workLabelAdapter.notifyDataSetChanged();
//                selectWorkView.setVisibility(View.GONE);
//                workTypeView.setText(selectSkill.name);
//                priceView.setText("￥" + selectSkill.price + "/h");
//                priceView.setVisibility(View.VISIBLE);
//                fillTotalPrice();
//            }
//        });
        return convertView;
    }

    class ViewHolder {
        TextView label;
    }
}
