package top.biduo.exchange.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import top.biduo.exchange.R;
import top.biduo.exchange.base.LinAdapter;
import top.biduo.exchange.entity.ChongBiBean;
import top.biduo.exchange.entity.TiBiBean;

import java.util.List;

/**
 * Created by Administrator on 2018/7/3.
 */
public class TiBiAdapter extends LinAdapter<TiBiBean> {
    private List<TiBiBean> beanss;
    /**
     * LinAdapter通用的构造方法
     *
     * @param context 传入的上下文
     * @param beans   要显示的数据源封装好的列表
     */
    public TiBiAdapter(Activity context, List<TiBiBean> beans) {
        super(context, beans);
        beanss=beans;
    }

    @Override
    protected View LgetView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = LayoutInflater.from(context).inflate(R.layout.adapter_tibi, parent, false);
        }
        TiBiBean bean = beanss.get(position);
        TextView text_coin=ViewHolders.get(convertView,R.id.text_coin);
        text_coin.setText(bean.name);

        TextView text_time=ViewHolders.get(convertView,R.id.text_time);
        text_time.setText(bean.time);

        TextView text_dizhi=ViewHolders.get(convertView,R.id.text_dizhi);
        text_dizhi.setText(bean.dizhi);

        TextView text_number=ViewHolders.get(convertView,R.id.text_number);
        text_number.setText(bean.number);


        TextView text_zhuangtai=ViewHolders.get(convertView,R.id.text_zhuangtai);
        text_zhuangtai.setText(bean.zhuangtai);

        TextView text_shouxufei=ViewHolders.get(convertView,R.id.text_shouxufei);
        text_shouxufei.setText(bean.shouxufei);


        return convertView;
    }
}
