package com.danding.yang800.Adapter;

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

import com.danding.yang800.Entity.AccountDetailedInfo;
import com.danding.yang800.Entity.TakeNotesInfo;
import com.danding.yang800.R;
import com.zhy.autolayout.utils.AutoUtils;

public class TakeNotesAdapter extends MyBaseAdapter<TakeNotesInfo> {

    public TakeNotesAdapter(Context context) {
        super(context);
    }

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        Info info = null;
        if (convertView == null) {
            convertView = inflater
                    .inflate(R.layout.take_notes_adapter, null);
            info = new Info();
            info.take_notes_adapterTv = (TextView) convertView.findViewById(R.id.take_notes_adapterTv);
            info.take_notes_adapterTimeTv = (TextView) convertView.findViewById(R.id.take_notes_adapterTimeTv);
            info.take_notes_adapterStateTv = (TextView) convertView.findViewById(R.id.take_notes_adapterStateTv);
            convertView.setTag(info);
            AutoUtils.autoSize(convertView);

        } else {
            info = (Info) convertView.getTag();
        }
//        Glide.with(context).load(getItem(position).getUrl()).error(R.drawable.shouye).diskCacheStrategy(DiskCacheStrategy.SOURCE).into(info.details_image);
//        info.details_price.setText("￥" + getItem(position).getPrice());
//        info.details_number.setText("x" + getItem(position).getNumber());
        info.take_notes_adapterTv.setText(getItem(position).getMoney());
        info.take_notes_adapterTimeTv.setText(getItem(position).getTime());
        info.take_notes_adapterStateTv.setText(getItem(position).getState());
        return convertView;
    }


    class Info {
        TextView take_notes_adapterTv;
        TextView take_notes_adapterTimeTv;
        TextView take_notes_adapterStateTv;
    }
}
