Exemplo n.º 1
1
  @Override
  public View getView(final int position, View convertView, final ViewGroup parent) {
    final ViewHolder viewHolder;

    if (convertView == null) {

      LayoutInflater vi = (LayoutInflater) base.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      convertView = vi.inflate(R.layout.item_reminder, parent, false);

      viewHolder = new ViewHolder();
      convertView.setTag(viewHolder);

      viewHolder.title = (TextView) convertView.findViewById(R.id.textViewReminderTitle);
      viewHolder.text = (TextView) convertView.findViewById(R.id.textViewReminderText);
      viewHolder.time = (TextView) convertView.findViewById(R.id.textViewReminderTime);
    } else {
      viewHolder = (ViewHolder) convertView.getTag();
    }

    String s = reminderList.get(position);

    String[] tokens = s.split(",");

    viewHolder.index = position;
    viewHolder.title.setText(tokens[1]);
    viewHolder.text.setText(tokens[2]);
    viewHolder.time.setText(tokens[3]);

    return convertView;
  }
Exemplo n.º 2
0
 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   Video item = getItem(position);
   ViewHolder holder = null;
   if (convertView == null) {
     convertView = mInflater.inflate(R.layout.item_history, parent, false);
     holder = new ViewHolder();
     holder.channel = (TextView) convertView.findViewById(R.id.channel);
     holder.title = (TextView) convertView.findViewById(R.id.title);
     holder.time = (TextView) convertView.findViewById(R.id.time);
     holder.image = (NetworkImageView) convertView.findViewById(R.id.image);
     holder.image.setDefaultImageResId(R.drawable.cover_night);
     convertView.setTag(holder);
   } else {
     holder = (ViewHolder) convertView.getTag();
   }
   if (mActivity instanceof HomeActivity) {
     String channel = ((HomeActivity) mActivity).findChannelNameById(item.channelId);
     holder.channel.setText(channel);
   }
   holder.title.setText(item.name);
   holder.time.setText("浏览于 " + AcApp.getPubDate(item.createtime));
   holder.image.setImageUrl(item.previewurl, AcApp.getGloableLoader());
   return convertView;
 }
Exemplo n.º 3
0
 @Override
 public View getView(int position, View view, ViewGroup arg2) {
   ViewHolder viewHolder;
   if (view == null) {
     viewHolder = new ViewHolder();
     view = getLayoutInflater().inflate(R.layout.item_traderesult, null);
     viewHolder.title = (TextView) view.findViewById(R.id.product_title);
     viewHolder.time = (TextView) view.findViewById(R.id.product_time);
     viewHolder.status = (TextView) view.findViewById(R.id.product_status);
     viewHolder.product_status = (TextView) view.findViewById(R.id.product_trade_status);
     viewHolder.money = (TextView) view.findViewById(R.id.product_money);
     view.setTag(viewHolder);
   } else {
     viewHolder = (ViewHolder) view.getTag();
   }
   JSONObject item = getItem(position);
   SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
   viewHolder.time.setText(sdf.format(item.optLong("tradeTime")));
   if (item.optString("tradeStatus").equals("0")) {
     viewHolder.status.setText("交易中");
   } else if (item.optString("tradeStatus").equals("1")) {
     viewHolder.status.setText("成功");
   } else {
     viewHolder.status.setText("失败");
   }
   viewHolder.product_status.setText(item.optString("tradeType"));
   viewHolder.title.setText(item.optString("proName"));
   viewHolder.money.setText(
       Html.fromHtml("<font color=#ff0000>" + item.optString("tradeMoney") + "</font>" + "元"));
   return view;
 }
Exemplo n.º 4
0
    @SuppressLint("NewApi")
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      ViewHolder holder;
      if (convertView == null) {
        holder = new ViewHolder();
        convertView = mInflater.inflate(R.layout.order_item, null);
        holder.date = (TextView) convertView.findViewById(R.id.item_date);
        holder.location = (TextView) convertView.findViewById(R.id.item_location);
        holder.name = (TextView) convertView.findViewById(R.id.item_name);
        holder.time = (TextView) convertView.findViewById(R.id.item_time);
        holder.type = (TextView) convertView.findViewById(R.id.item_type);
        holder.company = (TextView) convertView.findViewById(R.id.item_company);
        holder.isDone = (TextView) convertView.findViewById(R.id.item_isDone);
        convertView.setTag(holder);
      } else {
        holder = (ViewHolder) convertView.getTag();
      }
      TaskInfo taskInfo = tasklist.get(position);
      String ServiceDate = null;
      String serviceBegin = taskInfo.ServiceBegin();
      String serviceEnd = taskInfo.ServiceEnd();
      if (serviceBegin.equals(serviceEnd)) {
        ServiceDate = serviceBegin;
      } else {
        ServiceDate = serviceBegin + "-" + serviceEnd;
      }
      holder.time.setText(taskInfo.OnboardTime());
      holder.date.setText(ServiceDate);
      holder.location.setText(taskInfo.PickupAddress());
      holder.name.setText(taskInfo.Customer());
      holder.type.setText(taskInfo.ServiceTypeName());
      holder.company.setText(taskInfo.getCustomerCompany());
      String isUpdate = taskInfo.getIsUpdate();
      int readmark = taskInfo.getReadmark();
      if (taskInfo.getRouteNoteCount() > 0) {
        holder.isDone.setVisibility(View.VISIBLE);
        holder.isDone.setText("已完成");
        holder.isDone.setBackgroundColor(Color.parseColor("#009944"));
      } else if (null != pauseNote && pauseNote.getTaskID().equals(taskInfo.TaskID())) {
        holder.isDone.setVisibility(View.VISIBLE);
        holder.isDone.setText("暂停中");
        holder.isDone.setBackgroundColor(Color.parseColor("#eb6100"));

        //				holder.isDone.setBackground(getResources().getColor(R.color.colorYellow));
      } else if (readmark == 1) {
        holder.isDone.setVisibility(View.GONE);
      } else if (readmark == 0) {
        holder.isDone.setVisibility(View.VISIBLE);
        holder.isDone.setBackground(getResources().getDrawable(R.drawable.bg_red));
        if (isUpdate.equals("0")) {
          holder.isDone.setText("新增");
        } else {
          holder.isDone.setText("修改");
        }
      } else {
        holder.isDone.setVisibility(View.GONE);
      }
      return convertView;
    }
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder;

    if (convertView == null) {
      holder = new ViewHolder();
      convertView = inflater.inflate(R.layout.all_patient_appo_item, parent, false);
      holder.layout = (RelativeLayout) convertView.findViewById(R.id.layout);
      holder.date = (TextView) convertView.findViewById(R.id.date);
      holder.visitType = (TextView) convertView.findViewById(R.id.visitType);
      holder.time = (TextView) convertView.findViewById(R.id.time);
      convertView.setTag(holder);
    } else {
      holder = (ViewHolder) convertView.getTag();
    }
    final int pos = position;

    holder.date.setText(
        UtilSingleInstance.getInstance()
            .getOnlyDateFormattedInStringFormatUsingLong(appointment.get(position).getDateTime()));
    holder.time.setText(
        UtilSingleInstance.getInstance()
            .getOnlyTimeFormattedInStringFormatUsingLong(appointment.get(position).getDateTime()));
    holder.visitType.setText(
        UtilSingleInstance.getUserVisitType(appointment.get(position).getVisitType()));
    //  holder.time.setText(appointment.get(position).getBookTime());

    return convertView;
  }
Exemplo n.º 6
0
 public View getView(int position, View convertView, ViewGroup parent) {
   // position从上至下升序排列
   final ViewHolder viewHolder;
   String name, time, message;
   Integer head, read;
   final ChatRow entity = coll.get(position);
   if (convertView == null) {
     convertView = mInflater.inflate(R.layout.row_chat_history, null);
     viewHolder = new ViewHolder();
     viewHolder.userName = (TextView) convertView.findViewById(R.id.name_friend);
     viewHolder.time = (TextView) convertView.findViewById(R.id.time_friend);
     //            viewHolder.unRead=(TextView)convertView.findViewById(R.id.unread_msg_number);
     viewHolder.userMessage = (TextView) convertView.findViewById(R.id.message);
     viewHolder.userHead = (ImageView) convertView.findViewById(R.id.avatar_friend);
     convertView.setTag(viewHolder);
   } else {
     viewHolder = (ViewHolder) convertView.getTag();
   }
   name = entity.getChatName();
   time = entity.getChatTime();
   //        read=entity.getChatState();
   message = entity.getChatMessage();
   head = entity.getChatHead();
   viewHolder.userName.setText(name);
   viewHolder.time.setText(time);
   //        viewHolder.unRead.setText(read);
   viewHolder.userMessage.setText(message);
   viewHolder.userHead.setImageResource(head);
   return convertView;
 }
Exemplo n.º 7
0
 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   // TODO Auto-generated method stub
   index = position;
   ViewHolder holder = null;
   JoinCheck info = (JoinCheck) mList.get(position).get(INFO);
   String icon = info.getTitle();
   String result = info.getResult();
   String id = info.getCaseid();
   String time = info.getTime();
   String atm = info.getAtm();
   String state = info.getDisplayState();
   if (convertView == null) {
     convertView = mInflater.inflate(R.layout.join_check_listview_item, null);
     holder = new ViewHolder();
     holder.icon = (TextView) convertView.findViewById(R.id.join_check_item_text_icon);
     holder.id = (TextView) convertView.findViewById(R.id.join_check_item_text_id);
     holder.result = (TextView) convertView.findViewById(R.id.join_check_item_text_result);
     holder.atm = (TextView) convertView.findViewById(R.id.join_check_item_text_amt);
     holder.time = (TextView) convertView.findViewById(R.id.join_check_item_text_time);
     convertView.setTag(holder);
   } else {
     holder = (ViewHolder) convertView.getTag();
   }
   holder.icon.setText(icon);
   setResultColor(state, result, holder.result);
   holder.id.setText(id);
   holder.time.setText(time);
   holder.atm.setText(atm);
   return convertView;
 }
Exemplo n.º 8
0
 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   // TODO Auto-generated method stub
   index = position;
   final JcInfo info = (JcInfo) mList.get(position);
   convertView = mInflater.inflate(R.layout.notice_jc_listview_item, null);
   final ViewHolder holder = new ViewHolder();
   holder.time = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_time);
   holder.team = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team);
   holder.home = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team_name1);
   holder.away = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team_name2);
   holder.letPoint = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_vs);
   holder.timeEnd = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_time_end);
   holder.teamId = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_id);
   holder.result = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_jieguo);
   holder.score = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_score);
   convertView.setTag(holder);
   holder.time.append(info.getTime());
   holder.team.append(info.getTeam());
   holder.home.append(info.getHome());
   holder.away.append(info.getAway());
   holder.letPoint.setText(info.getLetPoint());
   holder.letPoint.setTextColor(Color.BLUE);
   holder.timeEnd.append(info.getTimeEnd());
   holder.teamId.append(info.getWeek() + info.getTeamId());
   holder.result.append(info.getResult());
   holder.score.append(info.getScore());
   return convertView;
 }
Exemplo n.º 9
0
 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   ViewHolder holder = null;
   if (convertView == null) {
     holder = new ViewHolder();
     convertView = LayoutInflater.from(context).inflate(R.layout.collection_list_item, null);
     holder.image = (ImageView) convertView.findViewById(R.id.collectionlistitemshopImage);
     holder.scoreImage = (ImageView) convertView.findViewById(R.id.collectionlistitemstarImage);
     holder.name = (TextView) convertView.findViewById(R.id.collectionlistitemshopText);
     holder.charge = (TextView) convertView.findViewById(R.id.collectionlistitemchargeText);
     holder.discountLayout =
         (LinearLayout) convertView.findViewById(R.id.collectionlistitemdiscountLayout);
     holder.time = (TextView) convertView.findViewById(R.id.collectionlistitemminuteText);
     holder.sale = (TextView) convertView.findViewById(R.id.collectionlistitemsalesText);
     convertView.setTag(holder);
   } else {
     holder = (ViewHolder) convertView.getTag();
   }
   Shop shop = (Shop) getItem(position);
   holder.name.setText(shop.getName());
   holder.sale.setText("月售" + shop.getSales() + "单");
   holder.charge.setText("起送价¥" + shop.getMinConsumption() + "|配送费" + shop.getDeliveryfee());
   // holder.time.setText(shop.getTime());
   return convertView;
 }
Exemplo n.º 10
0
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder = new ViewHolder();
    if (convertView == null) {
      convertView = inflater.inflate(R.layout.community_listview_item, null);
      holder.intro = (TextView) convertView.findViewById(R.id.shequ_item_activities);
      holder.title = (TextView) convertView.findViewById(R.id.shequ_item_name);
      holder.time = (TextView) convertView.findViewById(R.id.shequ_hot_item_time);
      holder.actimg = (ImageView) convertView.findViewById(R.id.shequ_head_pic_item);
      holder.shequ_item_activities_detail =
          (TextView) convertView.findViewById(R.id.shequ_item_activities_detail);
      convertView.setTag(holder);
    } else {
      holder = (ViewHolder) convertView.getTag();
      CommunityListbean listbean = list.get(position);
      holder.title.setText(listbean.getTitle());

      holder.time.setVisibility(View.VISIBLE);
      holder.time.setText(listbean.getTime());

      holder.shequ_item_activities_detail.setVisibility(View.GONE);
      holder.intro.setText(listbean.getDttype());
      String actimg = list.get(position).getActimg();
      //		    Picasso.with(context).load(Constant.COMMUNITY_IMAGE_URL+userpic).into(holder.userpic);
      bitmap.display(
          holder.actimg,
          Constant.COMMUNITY_IMAGE_URL + actimg,
          40,
          80,
          loadingBitmap,
          laodfailBitmap);
    }
    return convertView;
  }
Exemplo n.º 11
0
 /** 初始化View */
 private void initView(ViewHolder holder, View v) {
   holder.image = (NetworkImageView) v.findViewById(R.id.niv_question);
   holder.title = (TextView) v.findViewById(R.id.itemTitle);
   holder.count = (TextView) v.findViewById(R.id.itemCount);
   holder.time = (TextView) v.findViewById(R.id.itemTime);
   holder.size = (TextView) v.findViewById(R.id.itemSize);
   holder.radio = (CheckBox) v.findViewById(R.id.itemChecked);
   holder.mTvItemRightSave = v.findViewById(R.id.tv_item_right_save);
   holder.mTvItemRightDel = v.findViewById(R.id.tv_item_right_del);
   holder.duration = (TextView) v.findViewById(R.id.itemLength);
   v.setTag(holder);
 }
    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
      ViewHolder viewHolder = null;
      final VideoInfo f = getItem(position);
      if (convertView == null) {

        convertView = createConvertView(position);
        viewHolder = new ViewHolder();
        viewHolder.delete = (Button) convertView.findViewById(R.id.right_back_delete);
        viewHolder.title = ((TextView) convertView.findViewById(R.id.video_title));
        viewHolder.time = ((TextView) convertView.findViewById(R.id.video_time));
        viewHolder.size = ((TextView) convertView.findViewById(R.id.video_size));
        viewHolder.imageView = ((ImageView) convertView.findViewById(R.id.video_img));

        convertView.setTag(viewHolder);
      } else {
        viewHolder = (ViewHolder) convertView.getTag();
      }

      viewHolder.title.setText(f.displayName);

      viewHolder.time.setText(f.time);
      viewHolder.size.setText(f.Size);
      Bitmap bitmap = BitmapUtils.decodeBitmapFromSDCard(f.thumb_path, 80, 80);
      // 如果本地缓存图片被删除了,重新获取缩略图
      if (bitmap != null) {
        viewHolder.imageView.setImageBitmap(bitmap);
      } else {
        bitmap = getVideoThumbnail(f.path, 80, 80, MediaStore.Video.Thumbnails.MINI_KIND);
        if (bitmap == null)
          bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.default_video_img); // 默认图片

        viewHolder.imageView.setImageBitmap(bitmap);
      }

      if (viewHolder.delete != null) {

        viewHolder.delete.setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                mDbHelper.remove(mVideoList.get(position));
                mVideoList.remove(position);
                notifyDataSetChanged();
              }
            });
      }
      return convertView;
    }
Exemplo n.º 13
0
 public View getListItemView(
     Recharge item, View convertView, ViewGroup parent, LayoutInflater inflater) {
   ViewHolder holder;
   if (convertView == null) {
     convertView = inflater.inflate(R.layout.view_list_item_recharge_history, parent, false);
     holder = new ViewHolder();
     holder.amount = (TextView) convertView.findViewById(R.id.id_banlance_recharge_amount);
     holder.time = (TextView) convertView.findViewById(R.id.id_banlance_recharge_time);
     convertView.setTag(holder);
   } else {
     holder = (ViewHolder) convertView.getTag();
   }
   holder.amount.setText(Utils.formatMoney(item.getAmount()));
   holder.time.setText(item.getOrderTime());
   return convertView;
 }
Exemplo n.º 14
0
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    final ViewHolder vh;

    if (convertView == null) {
      vh = new ViewHolder();
      convertView = inflate(R.layout.plaza_nearby_useritem);

      vh.user_head = (SelectableRoundedImageView) convertView.findViewById(R.id.user_head);
      vh.user_name = (TextView) convertView.findViewById(R.id.user_name);
      vh.age = (TextView) convertView.findViewById(R.id.age);
      vh.line_1 = convertView.findViewById(R.id.line_1);
      vh.area = (TextView) convertView.findViewById(R.id.area);
      vh.line_2 = convertView.findViewById(R.id.line_2);
      vh.job = (TextView) convertView.findViewById(R.id.job);
      vh.time = (TextView) convertView.findViewById(R.id.distance);
      vh.declare = (TextView) convertView.findViewById(R.id.declare);

      convertView.setTag(vh);
    } else {
      vh = (ViewHolder) convertView.getTag();
    }
    if (isEmpty()) {
      return convertView;
    }

    UserInfo item = getItem(position);

    ModuleMgr.httpMgr.reqBigUserHeadImage(vh.user_head, item.getIcon());
    vh.user_name.setText(item.getNickName());
    vh.age.setText(item.getAge() + "岁");

    vh.line_1.setVisibility("".equals(item.getCity()) ? View.GONE : View.VISIBLE);
    vh.area.setVisibility("".equals(item.getCity()) ? View.GONE : View.VISIBLE);
    vh.area.setText(item.getCity());

    vh.line_2.setVisibility("".equals(item.getCity()) ? View.GONE : View.VISIBLE);
    vh.job.setVisibility("".equals(item.getCity()) ? View.GONE : View.VISIBLE);
    vh.job.setText(item.getJob());

    vh.time.setText(
        item.getOnline() == 1 ? "在线" : TimeUtil.formatBeforeTime(item.getOnline_timeout()));
    vh.declare.setText(item.getAboutme());

    return convertView;
  }
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    View rowView = convertView;
    ViewHolder viewHolder = null;
    if (rowView == null) {
      LayoutInflater inflate =
          (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      rowView = inflate.inflate(R.layout.row_dashboard_alert, null);
      viewHolder = new ViewHolder();
      viewHolder.avatar = (ImageView) rowView.findViewById(R.id.avatar);
      viewHolder.name = (TextView) rowView.findViewById(R.id.name);
      viewHolder.alert = (TextView) rowView.findViewById(R.id.alert);
      viewHolder.time = (RelativeTimeTextView) rowView.findViewById(R.id.time);
      viewHolder.icon = (ImageView) rowView.findViewById(R.id.icon);
      viewHolder.arrow = (ImageView) rowView.findViewById(R.id.arrow);

      rowView.setTag(viewHolder);
    } else {
      viewHolder = (ViewHolder) convertView.getTag();
    }

    DashboardGiftItem item = mlst.get(position);
    if (item.getPhoto().length() > 0) {
      Picasso.with(mContext)
          .load(item.getPhoto())
          .placeholder(R.drawable.avatar)
          .into(viewHolder.avatar);
    } else {
      viewHolder.avatar.setImageResource(R.drawable.avatar);
    }
    viewHolder.name.setText(item.getUsernameSend().toString());
    viewHolder.alert.setText("Sent you a gift");
    viewHolder.time.setReferenceTime(item.getTime());
    viewHolder.icon.setImageResource(R.drawable.ic_gift);
    viewHolder.arrow.setImageResource(R.drawable.arrow_right);
    if (item.getStatus() == 0) {
      rowView.setBackgroundColor(Color.parseColor("#e3f4f8"));
      viewHolder.icon.setImageResource(R.drawable.gift_icon);
      viewHolder.name.setTextColor(Color.parseColor("#101010"));
      viewHolder.name.setTypeface(null, Typeface.BOLD);
      viewHolder.alert.setTypeface(null, Typeface.BOLD);
    }

    return rowView;
  }
Exemplo n.º 16
0
    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
      View view = convertView;
      final ViewHolder holder;
      if (convertView == null) {
        view = LayoutInflater.from(context).inflate(R.layout.timeline_item, parent, false);
        holder = new ViewHolder();
        holder.location = (TextView) view.findViewById(R.id.tv_location);
        holder.time = (TextView) view.findViewById(R.id.tv_time);
        holder.description = (TextView) view.findViewById(R.id.tv_desc);
        holder.image = (ImageView) view.findViewById(R.id.iv_coverimg);
        view.setTag(holder);
      } else {
        holder = (ViewHolder) view.getTag();
      }
      final IndexModel model = data.get(position);
      holder.location.setText(model.location);
      Handler handler =
          new Handler() {

            @Override
            public void handleMessage(Message msg) {
              // TODO Auto-generated method stub
              super.handleMessage(msg);
              imageLoader.displayImage(
                  (String) msg.obj, holder.image, options, animateFirstListener);
            }
          };
      Hack.downloadPhoto(activity, model.coverImgUrl, handler);
      holder.image.setOnClickListener(
          new OnClickListener() {

            @Override
            public void onClick(View v) {
              // TODO Auto-generated method stub
              Intent intent = new Intent(activity, WaterfallActivity.class);
              intent.putExtra("galleryid", model.galleryID);
              activity.startActivity(intent);
            }
          });
      holder.time.setText(model.timeStart + "-" + model.timeEnd);
      holder.description.setText(model.galleryID);
      return view;
    }
Exemplo n.º 17
0
 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   // TODO Auto-generated method stub
   index = position;
   final JcInfo info = (JcInfo) mList.get(position);
   convertView = mInflater.inflate(R.layout.notice_jc_listview_item, null);
   final ViewHolder holder = new ViewHolder();
   holder.time = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_time);
   holder.team = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team);
   holder.home = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team_name1);
   holder.away = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_team_name2);
   holder.letPoint = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_vs);
   holder.timeEnd = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_time_end);
   holder.teamId = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_id);
   holder.result = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_jieguo);
   holder.score = (TextView) convertView.findViewById(R.id.jc_main_list_item_text_score);
   convertView.setTag(holder);
   holder.time.append(info.getTime());
   holder.team.append(info.getTeam());
   holder.home.append(info.getAway());
   holder.away.append(info.getHome());
   holder.letPoint.setText(info.getLetPoint());
   holder.letPoint.setTextColor(Color.BLUE);
   holder.timeEnd.append(info.getTimeEnd());
   holder.teamId.append(info.getWeek() + info.getTeamId());
   holder.result.append("主" + info.getResult());
   try {
     String scores[] = info.getScore().split("\\:");
     holder.score.append(scores[1] + ":" + scores[0]);
   } catch (Exception e) {
     // TODO: handle exception
   }
   //		    convertView.setOnClickListener(new OnClickListener() {
   //
   //				@Override
   //				public void onClick(View v) {
   //					// TODO Auto-generated method stub
   //					trunExplain(getEvent(Constants.JCBASKET, info));
   //				}
   //			});
   return convertView;
 }
Exemplo n.º 18
0
  @Override
  public View infalterView(int position, View convertView, ViewGroup parent) {
    ViewHolder viewHolder = null;
    if (convertView == null) {
      convertView = View.inflate(context, R.layout.carnest_user_info_itme, null);
      viewHolder = new ViewHolder();
      viewHolder.headSculpture = (RoundImageView) convertView.findViewById(R.id.roundImageView1);
      viewHolder.carId = (TextView) convertView.findViewById(R.id.textView1);
      viewHolder.time = (TextView) convertView.findViewById(R.id.textView4);
      viewHolder.name = (TextView) convertView.findViewById(R.id.textView3);
      viewHolder.phone = (TextView) convertView.findViewById(R.id.textView2);
      convertView.setTag(viewHolder);
    } else {
      viewHolder = (ViewHolder) convertView.getTag();
    }

    initItem(position, viewHolder);

    return convertView;
  }
  @Override
  public View getView(int position, View view, ViewGroup parent) {
    ViewHolder viewHolder;
    if (view == null) {
      view = layoutInflater.inflate(R.layout.events_item, null);
      viewHolder = new ViewHolder();
      viewHolder.name = (TextView) view.findViewById(R.id.event_title);
      viewHolder.price = (TextView) view.findViewById(R.id.event_price);
      viewHolder.place = (TextView) view.findViewById(R.id.event_place);
      viewHolder.time = (TextView) view.findViewById(R.id.event_time);
      viewHolder.icon = (ImageView) view.findViewById(R.id.event_image);
      view.setTag(viewHolder);
    } else {
      viewHolder = (ViewHolder) view.getTag();
    }
    EventItem item = getItem(position);

    /** Sets the icon. */
    int iconRes = 0;
    String category = item.getCategoryID();
    if (category.equals("SPORT")) iconRes = (R.drawable.category_sport);
    else if (category.equals("PERFORMANCES")) iconRes = (R.drawable.category_performances);
    else if (category.equals("MUSIC")) iconRes = (R.drawable.category_music);
    else if (category.equals("EXHIBITIONS")) iconRes = (R.drawable.category_exhibitions);
    else if (category.equals("NIGHTLIFE")) iconRes = (R.drawable.category_nightlife);
    else if (category.equals("PRESENTATIONS")) iconRes = (R.drawable.category_presentations);
    else if (category.equals("DEBATE")) iconRes = (R.drawable.category_debate);
    else if (category.equals("OTHER")) iconRes = (R.drawable.category_other);
    viewHolder.icon.setImageResource(iconRes);

    /** Sets the rest of the fields. */
    viewHolder.name.setText(item.getTitle());
    viewHolder.place.setText(item.getPlaceName());
    SimpleTimeFormat time = new SimpleTimeFormat(item.getDateStart());
    viewHolder.time.setText(time.getUserTimeDate());
    String free = getContext().getString(R.string.free);
    String cost = item.getPrice() <= 0 ? free : ((int) item.getPrice()) + " kr";
    viewHolder.price.setText(cost);

    return view;
  }
Exemplo n.º 20
0
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    View view = convertView;
    ViewHolder holder = null;

    if (view == null) {
      view = context.getLayoutInflater().inflate(R.layout.program_list_widget, null);
      holder = new ViewHolder();
      holder.title = (TextView) view.findViewById(R.id.title);
      holder.state = (ImageView) view.findViewById(R.id.state);
      holder.time = (TextView) view.findViewById(R.id.time);
      holder.date = (TextView) view.findViewById(R.id.date);
      holder.duration = (TextView) view.findViewById(R.id.duration);
      holder.progress = (TextView) view.findViewById(R.id.progress);
      holder.seriesInfo = (TextView) view.findViewById(R.id.series_info);
      holder.contentType = (TextView) view.findViewById(R.id.content_type);
      holder.summary = (TextView) view.findViewById(R.id.summary);
      holder.description = (TextView) view.findViewById(R.id.description);
      holder.genre = (TextView) view.findViewById(R.id.genre);
      view.setTag(holder);
    } else {
      holder = (ViewHolder) view.getTag();
    }

    // Get the program and assign all the values
    Program p = getItem(position);
    if (p != null) {
      holder.title.setText(p.title);
      Utils.setState(holder.state, p.recording);
      Utils.setDate(holder.date, p.start);
      Utils.setTime(holder.time, p.start, p.stop);
      Utils.setDuration(holder.duration, p.start, p.stop);
      Utils.setProgressText(holder.progress, p.start, p.stop);
      Utils.setDescription(null, holder.summary, p.summary);
      Utils.setDescription(null, holder.description, p.description);
      Utils.setContentType(null, holder.contentType, p.contentType);
      Utils.setSeriesInfo(null, holder.seriesInfo, p.seriesInfo);
      Utils.setGenreColor(context, holder.genre, p, TAG);
    }
    return view;
  }
Exemplo n.º 21
0
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder = null;
    if (convertView == null) {
      holder = new ViewHolder();
      convertView = mLayoutInflater.inflate(R.layout.video_list_view, null);
      holder.img = (ImageView) convertView.findViewById(R.id.video_img);
      holder.title = (TextView) convertView.findViewById(R.id.video_title);
      holder.time = (TextView) convertView.findViewById(R.id.video_time);
      convertView.setTag(holder);
    } else {
      holder = (ViewHolder) convertView.getTag();
    }
    holder.title.setText(listVideos.get(position).getTitle()); // ms
    long min = listVideos.get(position).getDuration() / 1000 / 60;
    long sec = listVideos.get(position).getDuration() / 1000 % 60;
    holder.time.setText(min + " : " + sec);
    holder.img.setImageBitmap(photos.get(position).getBitmap());

    return convertView;
  }
  @Override
  public View getView(final int i, View convertView, ViewGroup viewGroup) {
    ViewHolder holder;

    if (convertView == null) {

      convertView = inflater.inflate(R.layout.item_my_account, null);
      holder = new ViewHolder();

      holder.time = (TextView) convertView.findViewById(R.id.account_time);
      holder.balance = (TextView) convertView.findViewById(R.id.account_balance);
      holder.money = (TextView) convertView.findViewById(R.id.account_money);

      convertView.setTag(holder);
    }
    holder = (ViewHolder) convertView.getTag();
    final AccountRecord account = accounts.get(i);

    holder.balance.setText(account.recordBalance + "元");

    long time = account.recordCreated;
    Date date = new Date(time);
    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.CHINESE);
    String date1 = dateFormat.format(date);
    holder.time.setText(date1);

    holder.money.setText(account.recordMoney + "元");

    convertView.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            Intent intent = new Intent(context, AccountDetailActivity.class);
            intent.putExtra("account", account);
            context.startActivity(intent);
          }
        });

    return convertView;
  }
Exemplo n.º 23
0
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
          ViewHolder holder;
          if (convertView == null) {
            convertView =
                mInflater.inflate(R.layout.fragment_message_user_list_item, parent, false);
            holder = new ViewHolder();
            holder.icon = (ImageView) convertView.findViewById(R.id.icon);
            holder.icon.setFocusable(false);
            holder.title = (TextView) convertView.findViewById(R.id.title);
            holder.content = (TextView) convertView.findViewById(R.id.comment);
            holder.time = (TextView) convertView.findViewById(R.id.time);
            holder.badge = (BadgeView) convertView.findViewById(R.id.badge);
            holder.badge.setFocusable(false);
            convertView.setTag(holder);
          } else {
            holder = (ViewHolder) convertView.getTag();
          }

          Message.MessageObject user = (Message.MessageObject) getItem(position);
          iconfromNetwork(holder.icon, user.friend.avatar);
          holder.title.setText(user.friend.name);
          holder.content.setText(
              Global.recentMessage(user.content, myImageGetter, Global.tagHandler));
          holder.time.setText(Global.dayToNow(user.created_at));

          if (user.unreadCount > 0) {
            UnreadNotify.displayNotify(holder.badge, Unread.countToString(user.unreadCount));
            holder.badge.setVisibility(View.VISIBLE);
          } else {
            holder.badge.setVisibility(View.INVISIBLE);
          }

          if (position == (mData.size() - 1)) {
            loadMore();
          }

          return convertView;
        }
Exemplo n.º 24
0
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      ViewHolder vh;
      if (convertView == null) {
        convertView = getLayoutInflater().inflate(R.layout.li_info_list, null);
        vh = new ViewHolder();
        vh.head = (ImageView) convertView.findViewById(R.id.head);
        vh.phone = (TextView) convertView.findViewById(R.id.phone);
        vh.body = (TextView) convertView.findViewById(R.id.body);
        vh.time = (TextView) convertView.findViewById(R.id.time);
        convertView.setTag(vh);
      } else {
        vh = (ViewHolder) convertView.getTag();
      }

      Message c = getItem(position);
      if (c != null) {
        vh.phone.setText(c.phone);
        vh.body.setText(c.body);
        vh.time.setText(format.format(c.time));
      }
      return convertView;
    }
Exemplo n.º 25
0
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      ViewHolder holder;
      if (convertView == null) {
        convertView = mInflater.inflate(R.layout.itemnews, null);
        holder = new ViewHolder();
        holder.tit = (TextView) convertView.findViewById(R.id.txttitle);
        holder.time = (TextView) convertView.findViewById(R.id.txttime);

        convertView.setTag(holder);
      } else {
        holder = (ViewHolder) convertView.getTag();
      }
      if (position % 2 == 0) {
        convertView.setBackgroundColor(Color.parseColor("#ffffff"));
      } else {
        convertView.setBackgroundColor(Color.parseColor("#e9efe9"));
      }
      holder.tit.setText(rss1.get(position).getTitle());
      holder.time.setText(rss1.get(position).getPubDate());

      return convertView;
    }
Exemplo n.º 26
0
  @Override
  public View createView(LayoutInflater inflater, int position, WorkOrder data) {
    View convertView = inflater.inflate(R.layout.nowwork_content_item_bak, null);
    ViewHolder holder = new ViewHolder();
    holder.icon = (ImageView) convertView.findViewById(R.id.icon);
    holder.img_end = (ImageView) convertView.findViewById(R.id.img_end);
    holder.title = (TextView) convertView.findViewById(R.id.title);
    holder.titleValue = (TextView) convertView.findViewById(R.id.titleValue);
    holder.num = (TextView) convertView.findViewById(R.id.num);
    holder.numValue = (TextView) convertView.findViewById(R.id.numValue);
    holder.time = (TextView) convertView.findViewById(R.id.time);
    holder.timeValue = (TextView) convertView.findViewById(R.id.timeValue);
    holder.itme = (TextView) convertView.findViewById(R.id.itme);
    holder.itmeValue = (TextView) convertView.findViewById(R.id.itmeValue);
    holder.colour = (TextView) convertView.findViewById(R.id.colour);
    holder.colourValue = (TextView) convertView.findViewById(R.id.colourValue);
    holder.six = (TextView) convertView.findViewById(R.id.six);
    holder.sixValue = (TextView) convertView.findViewById(R.id.sixValue);
    convertView.setTag(holder);

    fillData(holder, data);
    return convertView;
  }
  @Override
  public View getView(Context c, LayoutInflater inflater, View convertView) {
    ViewHolder holder;
    if (convertView == null || !(convertView.getTag() instanceof ViewHolder)) {
      convertView = inflater.inflate(R.layout.list_item_notification_score, null, false);

      holder = new ViewHolder();
      holder.header = (TextView) convertView.findViewById(R.id.card_header);
      holder.title = (TextView) convertView.findViewById(R.id.title);
      holder.matchView = (MatchView) convertView.findViewById(R.id.match_details);
      holder.time = (TextView) convertView.findViewById(R.id.notification_time);
      holder.summaryContainer = convertView.findViewById(R.id.summary_container);
      convertView.setTag(holder);
    } else {
      holder = (ViewHolder) convertView.getTag();
    }

    holder.header.setText(
        c.getString(
            R.string.gameday_ticker_event_title_format,
            EventHelper.shortName(eventName),
            EventHelper.getShortCodeForEventKey(eventKey).toUpperCase()));
    holder.title.setText(
        c.getString(
            R.string.notification_score_gameday_title,
            MatchHelper.getMatchTitleFromMatchKey(c, matchKey)));
    holder.time.setText(getNotificationTimeString(c));
    holder.summaryContainer.setOnClickListener(new GamedayTickerClickListener(c, this));

    MatchListElement renderedMatch =
        mRenderer.renderFromModel(match, MatchRenderer.RENDER_NOTIFICATION);
    if (renderedMatch != null) {
      renderedMatch.getView(c, inflater, holder.matchView);
    }

    return convertView;
  }
  @SuppressLint("InflateParams")
  @Override
  public View getView(int arg0, View view, ViewGroup arg2) {
    // TODO Auto-generated method stub
    ViewHolder viewHolder;
    if (view == null) {
      view = LayoutInflater.from(notifyListPage).inflate(R.layout.item_delete, null);
      viewHolder = new ViewHolder();
      viewHolder.icon = (ImageView) view.findViewById(R.id.icon);
      viewHolder.title = (TextView) view.findViewById(R.id.title_tx);
      viewHolder.content = (TextView) view.findViewById(R.id.content_tx);
      viewHolder.time = (TextView) view.findViewById(R.id.time_tx);
      viewHolder.count = (TextView) view.findViewById(R.id.count);
      view.setTag(viewHolder);
    } else {
      viewHolder = (ViewHolder) view.getTag();
    }

    final GotyeNotify notify = (GotyeNotify) getItem(arg0);

    viewHolder.title.setText(notify.getText());
    viewHolder.content.setVisibility(View.GONE);
    viewHolder.icon.setImageResource(R.drawable.contact_group);

    //		switch (notify.getType()) {
    //		case GroupInvite:
    //
    //			if (notify.isRead()) {
    //				viewHolder.reject.setVisibility(View.VISIBLE);
    //				viewHolder.agree.setVisibility(View.GONE);
    //				viewHolder.reject.setText("删除");
    //				viewHolder.reject.setOnClickListener(new OnClickListener() {
    //
    //					@Override
    //					public void onClick(View arg0) {
    //						GotyeAPI.getInstance().deleteNotify(notify);
    //
    //						notifyListPage.refresh();
    //					}
    //				});
    //			} else {
    //				viewHolder.reject.setVisibility(View.VISIBLE);
    //				viewHolder.reject.setOnClickListener(new OnClickListener() {
    //					@Override
    //					public void onClick(View arg0) {
    //						notify.setRead(true);
    //						GotyeAPI.getInstance().markNotifyIsread(notify);
    //						notifyListPage.refresh();
    //					}
    //				});
    //				viewHolder.agree.setVisibility(View.VISIBLE);
    //				viewHolder.agree.setText("加入该群");
    //				viewHolder.agree.setOnClickListener(new OnClickListener() {
    //					@Override
    //					public void onClick(View arg0) {
    //						GotyeAPI.getInstance().joinGroup(
    //								new GotyeGroup(notify.getFrom().Id));
    //						notify.setRead(true);
    //						GotyeAPI.getInstance().markNotifyIsread(notify);
    //						ProgressDialogUtil.showProgress(notifyListPage, "正在加入..");
    //						notifyListPage.refresh();
    //					}
    //				});
    //			}
    //
    //
    //			break;
    //		case JoinGroupReply:
    //
    //			if (notify.isRead()) {
    //				viewHolder.reject.setVisibility(View.VISIBLE);
    //				viewHolder.agree.setVisibility(View.GONE);
    //				viewHolder.reject.setText("删除");
    //				viewHolder.reject.setOnClickListener(new OnClickListener() {
    //
    //					@Override
    //					public void onClick(View arg0) {
    //						GotyeAPI.getInstance().deleteNotify(notify);
    //						notifyListPage.refresh();
    //					}
    //				});
    //			} else {
    //				viewHolder.reject.setVisibility(View.GONE);
    //				viewHolder.agree.setVisibility(View.VISIBLE);
    //				viewHolder.agree.setText("知道了");
    //				viewHolder.agree.setOnClickListener(new OnClickListener() {
    //					@Override
    //					public void onClick(View arg0) {
    //						notify.setRead(true);
    //						GotyeAPI.getInstance().markNotifyIsread(notify);
    //						notifyListPage.refresh();
    //					}
    //				});
    //			}
    //
    //			break;
    //		case JoinGroupRequest:
    //			if (notify.isRead()) {
    //				viewHolder.reject.setVisibility(View.VISIBLE);
    //				viewHolder.agree.setVisibility(View.GONE);
    //				viewHolder.reject.setText("删除");
    //				viewHolder.reject.setOnClickListener(new OnClickListener() {
    //
    //					@Override
    //					public void onClick(View arg0) {
    //						GotyeAPI.getInstance().deleteNotify(notify);
    //						notifyListPage.refresh();
    //					}
    //				});
    //			} else {
    //				viewHolder.reject.setVisibility(View.VISIBLE);
    //				viewHolder.agree.setVisibility(View.VISIBLE);
    //				viewHolder.agree.setText("同意");
    //				viewHolder.agree.setOnClickListener(new OnClickListener() {
    //					@Override
    //					public void onClick(View arg0) {
    //						notify.setRead(true);
    //						GotyeAPI.getInstance().markNotifyIsread(notify);
    //						notifyListPage.refresh();
    //
    //	GotyeAPI.getInstance().replyJoinGroup((GotyeUser)notify.getSender(),(GotyeGroup)notify.getFrom(),"欢迎加入",true);
    //					}
    //				});
    //				viewHolder.reject.setText("拒绝");
    //				viewHolder.reject.setOnClickListener(new OnClickListener() {
    //					@Override
    //					public void onClick(View arg0) {
    //						notify.setRead(true);
    //						GotyeAPI.getInstance().markNotifyIsread(notify);
    //						notifyListPage.refresh();
    //
    //	GotyeAPI.getInstance().replyJoinGroup((GotyeUser)notify.getSender(),(GotyeGroup)notify.getFrom(),"不同意",false);
    //					}
    //				});
    //			}
    //			break;
    //		default:
    //			break;
    //		}

    viewHolder.count.setVisibility(notify.isRead() ? View.GONE : View.VISIBLE);
    return view;
  }
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    if (convertView == null) {
      convertView = inflater.inflate(R.layout.row_chat_history, parent, false);
    }
    ViewHolder holder = (ViewHolder) convertView.getTag();
    if (holder == null) {
      holder = new ViewHolder();
      holder.name = (TextView) convertView.findViewById(R.id.name);
      holder.unreadLabel = (TextView) convertView.findViewById(R.id.unread_msg_number);
      holder.message = (TextView) convertView.findViewById(R.id.message);
      holder.time = (TextView) convertView.findViewById(R.id.time);
      holder.avatar = (ImageView) convertView.findViewById(R.id.avatar);
      holder.msgState = convertView.findViewById(R.id.msg_state);
      holder.list_item_layout = (RelativeLayout) convertView.findViewById(R.id.list_item_layout);
      convertView.setTag(holder);
    }
    if (position % 2 == 0) {
      holder.list_item_layout.setBackgroundResource(R.drawable.mm_listitem);
    } else {
      holder.list_item_layout.setBackgroundResource(R.drawable.mm_listitem_grey);
    }

    // 获取与此用户/群组的会话
    EMConversation conversation = getItem(position);
    // 获取用户username或者群组groupid
    String username = conversation.getUserName();
    if (conversation.getType() == EMConversationType.GroupChat) {
      // 群聊消息,显示群聊头像
      holder.avatar.setImageResource(R.drawable.group_icon);
      EMGroup group = EMGroupManager.getInstance().getGroup(username);
      holder.name.setText(group != null ? group.getGroupName() : username);
    } else if (conversation.getType() == EMConversationType.ChatRoom) {
      holder.avatar.setImageResource(R.drawable.group_icon);
      EMChatRoom room = EMChatManager.getInstance().getChatRoom(username);
      holder.name.setText(
          room != null && !TextUtils.isEmpty(room.getName()) ? room.getName() : username);
    } else {
      UserUtils.setUserAvatar(getContext(), username, holder.avatar);
      if (username.equals(Constant.GROUP_USERNAME)) {
        holder.name.setText("群聊");

      } else if (username.equals(Constant.NEW_FRIENDS_USERNAME)) {
        holder.name.setText("申请与通知");
      }
      Map<String, RobotUser> robotMap =
          ((DemoHXSDKHelper) HXSDKHelper.getInstance()).getRobotList();
      if (robotMap != null && robotMap.containsKey(username)) {
        String nick = robotMap.get(username).getNick();
        if (!TextUtils.isEmpty(nick)) {
          holder.name.setText(nick);
        } else {
          holder.name.setText(username);
        }
      } else {
        UserUtils.setUserNick(username, holder.name);
      }
    }

    if (conversation.getUnreadMsgCount() > 0) {
      // 显示与此用户的消息未读数
      holder.unreadLabel.setText(String.valueOf(conversation.getUnreadMsgCount()));
      holder.unreadLabel.setVisibility(View.VISIBLE);
    } else {
      holder.unreadLabel.setVisibility(View.INVISIBLE);
    }

    if (conversation.getMsgCount() != 0) {
      // 把最后一条消息的内容作为item的message内容
      EMMessage lastMessage = conversation.getLastMessage();
      holder.message.setText(
          SmileUtils.getSmiledText(
              getContext(), getMessageDigest(lastMessage, (this.getContext()))),
          BufferType.SPANNABLE);

      holder.time.setText(DateUtils.getTimestampString(new Date(lastMessage.getMsgTime())));
      if (lastMessage.direct == EMMessage.Direct.SEND
          && lastMessage.status == EMMessage.Status.FAIL) {
        holder.msgState.setVisibility(View.VISIBLE);
      } else {
        holder.msgState.setVisibility(View.GONE);
      }
    }

    return convertView;
  }
Exemplo n.º 30
0
  @Override
  public View getView(final int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    ViewHolder vh;
    if (convertView == null) {
      vh = new ViewHolder();
      convertView = LayoutInflater.from(context).inflate(R.layout.track_fragment_item_item, null);
      vh.tv_user_sex = (TextView) convertView.findViewById(R.id.tv_user_sex);
      vh.tv_user_rank = (TextView) convertView.findViewById(R.id.tv_user_rank);
      vh.name = (TextView) convertView.findViewById(R.id.travel_fragment_item_name);
      vh.comment = (TextView) convertView.findViewById(R.id.travel_fragment_item_commend);
      vh.content = (TextView) convertView.findViewById(R.id.travel_fragment_item_content);
      vh.good = (TextView) convertView.findViewById(R.id.travel_fragment_item_good);
      vh.share = (TextView) convertView.findViewById(R.id.travel_fragment_item_share);
      vh.time = (TextView) convertView.findViewById(R.id.travel_fragment_item_time);
      vh.imageView = (CircleImageView) convertView.findViewById(R.id.travel_fragment_item_image);
      vh.largeimage = (ImageView) convertView.findViewById(R.id.travel_fragment_item_largeimage);
      vh.collect = (TextView) convertView.findViewById(R.id.travel_fragment_item_collection);
      vh.relayout = (RelativeLayout) convertView.findViewById(R.id.track_fragment_item_Relayout);
      vh.relayout2 = (RelativeLayout) convertView.findViewById(R.id.travel_fragment_item_Relayout);
      convertView.setTag(vh);
    } else {
      vh = (ViewHolder) convertView.getTag();
    }
    vh.relayout.setVisibility(View.GONE);
    vh.relayout2.setVisibility(View.VISIBLE);
    WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    ViewGroup.LayoutParams para;
    para = vh.largeimage.getLayoutParams();
    para.height = wm.getDefaultDisplay().getWidth() * 3 / 4;
    para.width = wm.getDefaultDisplay().getWidth();
    vh.largeimage.setLayoutParams(para);

    if ("1".equals(list.get(position).getSex())) {
      vh.tv_user_sex.setText("男");
      vh.tv_user_sex.setBackgroundResource(R.drawable.corner_view_left);
      vh.tv_user_rank.setBackgroundResource(R.drawable.corner_view_right);
    } else if ("2".equals(list.get(position).getSex())) {
      vh.tv_user_sex.setText("女");
      vh.tv_user_sex.setBackgroundResource(R.drawable.corner_view_left_sex);
      vh.tv_user_rank.setBackgroundResource(R.drawable.corner_view_right_sex);
    }
    vh.tv_user_rank.setText(list.get(position).getLevel().getLvName());
    vh.name.setText(list.get(position).getNickname());
    vh.share.setText(list.get(position).getShare());
    vh.good.setText(list.get(position).getPraise());
    vh.share.setText(list.get(position).getShare());

    vh.content.setText(SmileUtils.getSmiledText(context, list.get(position).getTitle()));
    vh.comment.setText(list.get(position).getComment());
    vh.time.setText(getStringTime(list.get(position).getModtime()));

    vh.collect.setText(list.get(position).getCollect());
    vh.imageView.setImageUrl(
        UrlPools.getFriendAvatarUrl(context, list.get(position).getUserid()), imageLoader);

    String url =
        UrlPools.QINIU + list.get(position).getImage().getSingle().getFileurl() + "-Thumb640";
    DisplayImageOptions options =
        new DisplayImageOptions.Builder()
            .showStubImage(R.drawable.imgurl) // 加载开始默认的图片
            .showImageForEmptyUri(R.drawable.imgurl) // url爲空會显示该图片,自己放在drawable里面的
            .showImageOnFail(R.drawable.imgurl) // 加载图片出现问题,会显示该图片
            .cacheInMemory() // 缓存用
            .cacheOnDisc() // 缓存用
            .build();
    imageLoader2.displayImage(url, vh.largeimage, options);
    vh.imageView.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            Intent intent = new Intent(context, UserDetailsActivity.class);
            intent.putExtra("friendid", list.get(position).getUserid());
            context.startActivity(intent);
          }
        });
    return convertView;
  }