/** * @param holder * @param youbi */ private void setDetailData(ViewHolder holder, UserYoubiDetail youbi) { String text = null; ImageViewUtil.showImage(holder.image, youbi.getUserIcon(), R.drawable.postbar_thumbimg_default); if (youbi.getBusinessType() == 1) { if (youbi.getChannel() == 1) { text = "支付宝充值" + DoubleUtil.getDoubleFormat(youbi.getAmountRmb()) + "元"; } else if (youbi.getChannel() == 2) { text = "微信充值" + DoubleUtil.getDoubleFormat(youbi.getAmountRmb()) + "元"; } } else if (youbi.getBusinessType() == 2) { text = "陪玩收入"; } else if (youbi.getBusinessType() == 3) { text = "支付陪玩"; } else if (youbi.getBusinessType() == 4) { text = "提现" + DoubleUtil.getDoubleFormat(youbi.getAmountRmb()) + "元"; } else if (youbi.getBusinessType() == 5) { if (youbi.getAmountYoubi() > 0) { text = "系统赠送"; } else { text = "系统扣除"; } } else if (youbi.getBusinessType() == 6) { text = "支付陪玩技术服务费"; } holder.paytitle.setText(text); LogUtil.d("pay", youbi.getCreateTime() + ""); holder.paytime.setText( new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date(youbi.getCreateTime()))); holder.paymoney.setText(DoubleUtil.getDoubleFormat(youbi.getAmountYoubi()) + "U币"); getTradeText(youbi, holder.paystatus); }
/* * (non-Javadoc) * * @see android.widget.SimpleAdapter#getView(int, android.view.View, * android.view.ViewGroup) */ @SuppressWarnings("unchecked") @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = new ViewHolder(); ; if (convertView == null) { convertView = this.inflater.inflate(R.layout.splendid_group_list_item, null); holder.gnameTxt = (TextView) convertView.findViewById(R.id.gnameTxt); // 公会名称 holder.groupId = (TextView) convertView.findViewById(R.id.group_id); // 公会ID holder.avatarView = (ImageView) convertView.findViewById(R.id.icon); // 公会头像 holder.desc1 = (TextView) convertView.findViewById(R.id.desc1); // 公会人数 holder.desc2 = (TextView) convertView.findViewById(R.id.desc2); // 会长 holder.gameIcon = (ImageView) convertView.findViewById(R.id.gameIcon); // 贴吧头像 holder.grade = (TextView) convertView.findViewById(R.id.grade); // 公会等级 convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } Map<String, Object> mapData = (HashMap<String, Object>) getItem(position); String title = null; if (mapData.containsKey("title")) { title = (String) mapData.get("title"); holder.gnameTxt.setText(title); } // 显示公会头像 String avatar = null; if (mapData.containsKey("pic")) { avatar = (String) mapData.get("pic"); // 公会头像 ImageViewUtil.showImage(holder.avatarView, avatar, R.drawable.common_default_icon); } // 贴吧头像 String gameIcon = null; if (mapData.containsKey("logo")) { gameIcon = (String) mapData.get("logo"); // 贴吧头像 ImageViewUtil.showImage(holder.gameIcon, gameIcon, R.drawable.common_default_icon); } // 公会ID long gid; if (mapData.containsKey("grId")) { gid = Long.valueOf(mapData.get("grId").toString()); ; } // 公会等级 if (mapData.containsKey("grade")) { holder.grade.setText("LV" + mapData.get("grade")); } else { holder.grade.setText("LV0"); } // 公会人数 if (mapData.containsKey("total") && mapData.containsKey("maxCount")) { holder.desc1.setText("公会人数:" + mapData.get("total") + "/" + mapData.get("maxCount")); } else { holder.desc1.setText("公会人数:" + "0/0"); } // 公会会长 if (mapData.containsKey("presidentName")) { holder.desc2.setText("会长:" + mapData.get("presidentName")); } else { holder.desc2.setText("会长:"); } // 公会显示ID if (mapData.containsKey("serial")) { holder.groupId.setText("" + mapData.get("serial")); } return convertView; }