@Override public View getView(final int position, View convertView, ViewGroup parent) { LogUtil.i("=position=" + position); ZzhViewHolder vh = null; if (convertView == null) { vh = new ZzhViewHolder(); convertView = LayoutInflater.from(context).inflate(R.layout.zizhanghu_item, null); vh.txtUserName = (TextView) convertView.findViewById(R.id.txtUserName); vh.txtTrueName = (TextView) convertView.findViewById(R.id.txtTrueName); vh.ivDongjie = (ImageView) convertView.findViewById(R.id.ivDongjie); vh.layout = (LinearLayout) convertView.findViewById(R.id.layout); convertView.setTag(vh); } else { vh = (ZzhViewHolder) convertView.getTag(); } vh.ivDongjie.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { callBack.gotoDongjie(position); } }); ZiZhanghuInfo info = list.get(position); vh.txtUserName.setText("µÇ¼Õʺţº" + info.getUserName()); vh.txtTrueName.setText("ÐÕ Ãû£º" + info.getTrueName()); if (!StringUtil.isStringEmpty(info.getStatus()) && info.getStatus().equals("1")) { vh.ivDongjie.setImageResource(0); } else { vh.ivDongjie.setImageResource(R.drawable.per_gou_yes); } if (!isDoctor) { vh.layout.setVisibility(View.GONE); } else { vh.layout.setVisibility(View.VISIBLE); } return convertView; }
@Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder vh = null; LogUtil.d("SfHuaYanAdapter getView() pos: " + position); if (convertView == null) { vh = new ViewHolder(); convertView = LayoutInflater.from(context).inflate(R.layout.suifang_huayan_item, null); vh.img = (ImageView) convertView.findViewById(R.id.img); convertView.setTag(vh); } else { vh = (ViewHolder) convertView.getTag(); } LayoutUtil.setBitmap(vh.img, list.get(position)); return convertView; }