Пример #1
0
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      // TODO Auto-generated method stub
      index = position;
      ViewHolder holder = null;
      Info info = (Info) mList.get(position).get(INFO);

      if (convertView == null) {
        convertView = mInflater.inflate(R.layout.join_info_listview_item, null);
        holder = new ViewHolder();
        holder.name = (TextView) convertView.findViewById(R.id.join_info_item_text_name);
        holder.starNum = (LinearLayout) convertView.findViewById(R.id.join_info_item_linear_star);
        holder.progress = (TextView) convertView.findViewById(R.id.join_info_item_text_progress);
        holder.allAtm = (TextView) convertView.findViewById(R.id.join_info_item_text_all_amt);
        holder.atm = (TextView) convertView.findViewById(R.id.join_info_item_text_amt);
        convertView.setTag(holder);
      } else {
        holder = (ViewHolder) convertView.getTag();
      }
      holder.name.setText("发起人:" + info.getName());
      holder.progress.setText(info.getProgress());
      holder.allAtm.setText("¥" + info.getAllAtm());
      holder.atm.setText("¥" + info.getAtm());
      PublicMethod.createStar(
          holder.starNum,
          info.getCrown(),
          info.getCup(),
          info.getDiamond(),
          info.getStarNum(),
          JoinInfoActivity.this);
      return convertView;
    }
Пример #2
0
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      // TODO Auto-generated method stub
      index = position;
      ViewHolder holder = null;
      Info info = (Info) mList.get(position);

      if (convertView == null) {
        convertView = mInflater.inflate(R.layout.join_info_listview_item, null);
        holder = new ViewHolder();
        holder.type = (TextView) convertView.findViewById(R.id.join_info_item_text_name);
        holder.ding = (TextView) convertView.findViewById(R.id.join_info_item_text_ding);
        holder.name = (TextView) convertView.findViewById(R.id.join_info_item_text_faqiren);
        holder.starNum = (LinearLayout) convertView.findViewById(R.id.join_info_item_linear_star);
        holder.progress = (TextView) convertView.findViewById(R.id.join_info_item_text_progress);
        holder.allAtm = (TextView) convertView.findViewById(R.id.join_info_item_text_all_amt);
        holder.layoutLeft =
            (LinearLayout) convertView.findViewById(R.id.join_info_item_layout_left);
        holder.layoutCenter =
            (LinearLayout) convertView.findViewById(R.id.join_info_item_layout_center);
        holder.layoutRight =
            (LinearLayout) convertView.findViewById(R.id.join_info_item_layout_right);
        convertView.setTag(holder);
      } else {
        holder = (ViewHolder) convertView.getTag();
      }
      if (info.getIsTop().equals("true")) {
        holder.ding.setBackgroundResource(R.drawable.join_top);
        holder.ding.setVisibility(view.VISIBLE);
      } else {
        holder.ding.setVisibility(view.GONE);
      }
      int with = PublicMethod.getDisplayWidth(JoinInfoActivity.this);
      if (with == 800) {
        LinearLayout.LayoutParams params =
            new LinearLayout.LayoutParams(
                PublicMethod.getPxInt(110, JoinInfoActivity.this),
                PublicMethod.getPxInt(28, JoinInfoActivity.this));
        holder.type.setLayoutParams(params);
        LinearLayout.LayoutParams paramsLayout =
            new LinearLayout.LayoutParams(250, LayoutParams.WRAP_CONTENT);
        holder.layoutLeft.setLayoutParams(paramsLayout);
        holder.layoutCenter.setLayoutParams(paramsLayout);
        holder.layoutRight.setLayoutParams(paramsLayout);
      }
      holder.type.setText(info.getLottype());
      holder.name.setText("发起人:" + getusername(info.getName()));
      holder.progress.setText(info.getProgress() + "(" + info.getSafe() + ")");
      holder.allAtm.setText(info.getAllAtm() + "元");
      // holder.atm.setText("¥"+info.getAtm());
      // holder.safe.setText(info.getSafe());
      PublicMethod.createStar(
          holder.starNum,
          info.getCrown(),
          info.getGrayCrown(),
          info.getCup(),
          info.getGrayCup(),
          info.getDiamond(),
          info.getGrayDiamond(),
          info.getStarNum(),
          info.getGrayStarNum(),
          JoinInfoActivity.this,
          4);
      return convertView;
    }