Exemplo n.º 1
0
    @Override
    public void bindView(View view) {
      ViewHolder holder = (ViewHolder) view.getTag();
      LayoutInflater inflater = LayoutInflater.from(context);
      Resources res = context.getResources();

      holder.infoContainer.removeAllViews();
      addNewInfoItem(
          contact.getNickname(),
          ConstantCode.getSexImageResource(contact.getSex()),
          inflater,
          holder.infoContainer);
      addNewInfoItem(
          context.getString(R.string.label_code) + contact.getLabelCode(),
          inflater,
          holder.infoContainer);
      if (contact.getAge() > 0) {
        addNewInfoItem(
            MiscUtils.getAgeString(res, contact.getAge()), inflater, holder.infoContainer);
      }
      if (contact.getHeight() > 0) {
        addNewInfoItem(
            MiscUtils.getHeightString(res, contact.getHeight()), inflater, holder.infoContainer);
      }
      if (contact.getConstellation() > 0) {
        addNewInfoItem(
            MiscUtils.getConstellationString(res, contact.getConstellation()),
            inflater,
            holder.infoContainer);
      }
      if (!TextUtils.isEmpty(contact.getSchool())) {
        addNewInfoItem(contact.getSchool(), inflater, holder.infoContainer);
      }
      if (!TextUtils.isEmpty(contact.getJob())) {
        addNewInfoItem(contact.getJob(), inflater, holder.infoContainer);
      }
    }
Exemplo n.º 2
0
 public static String getHeightString(Resources resources, int height) {
   return MiscUtils.getHeightString(resources, height);
 }