• 寒假学习日报28


    public class CostListAdapter extends BaseAdapter {
    
        private List<CostBean> mList;
        private Context mContext;
        private LayoutInflater mLayoutInflater;
    
        public CostListAdapter(Context context, List<CostBean> list) {
            mContext = context;
            mList = list;
            mLayoutInflater = LayoutInflater.from(context);
        }
    
        @Override
        public int getCount() {
            return mList.size();
        }
    
        @Override
        public Object getItem(int position) {
            return mList.get(position);
        }
    
        @Override
        public long getItemId(int position) {
            return position;
        }
    
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            ViewHolder viewHolder;
            if(convertView == null){
                viewHolder = new ViewHolder();
                convertView = mLayoutInflater.inflate(R.layout.list_item, null);
                viewHolder.mTvCostTitle = (TextView) convertView.findViewById(R.id.tv_title);
                viewHolder.mTvCostDate = (TextView)convertView.findViewById(R.id.tv_date);
                viewHolder.mTvCostMoney =(TextView) convertView.findViewById(R.id.tv_cost);
                convertView.setTag(viewHolder);
            }else{
                viewHolder = (ViewHolder) convertView.getTag();
            }
            CostBean bean = mList.get(position);
            viewHolder.mTvCostTitle.setText(bean.costTitle);
            viewHolder.mTvCostDate.setText(bean.costDate);
            viewHolder.mTvCostMoney.setText(bean.costMoney);
            return convertView;
        }
    
        private static class ViewHolder{
            public TextView mTvCostTitle;
            public TextView mTvCostDate;
            public TextView mTvCostMoney;
        }
    }
  • 相关阅读:
    sqli-labs Less29-Less31
    sqli-labs Less23-Less28a
    sqli-labs Less20-Less22
    sqli-labs Less17--Less19
    sqli-labs Less13-Less16
    为什么选择centos,而不是Dibian、Ubuntu【转】
    sublime 安装常用插件
    Linux常用命令
    在UEFI下安装windows和Ubuntu双系统目前不可行
    nginx 环境搭建(基于linux)
  • 原文地址:https://www.cnblogs.com/hhw12345/p/14909593.html
Copyright © 2020-2023  润新知