private void initUserMsg() {
    if (SupplierApplication.getInstance().getUser() != null) {
      tvUserName.setText(
          getString(R.string.hello)
              + SupplierApplication.getInstance().getUser().content.userInfo.fullName);

      initHeadLogo();
    }
  }
 @Override
 public void onSuccess(Object obj) {
   requestSystemMessage();
   SupplierApplication.getInstance().setUser((User) obj);
   RequestCenter.boundAccount(new SimpleDisposeDataListener(), true);
   initUserMsg();
 }
  private void initHeadLogo() {
    ImageUtil.getImageLoader()
        .displayImage(
            SupplierApplication.getInstance().getUser().content.companyInfo.logo,
            ivUserLogo,
            new ImageLoadingListener() {
              @Override
              public void onLoadingStarted(String imageUri, View view) {}

              @Override
              public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
                ivUserLogo.setImageResource(R.drawable.ic_head_default);
              }

              @Override
              public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
                if (loadedImage != null) {
                  ivUserLogo.setImageBitmap(ImageUtil.toRoundBitmap(loadedImage));
                } else {
                  ivUserLogo.setImageResource(R.drawable.ic_head_default);
                }
              }

              @Override
              public void onLoadingCancelled(String imageUri, View view) {}
            });
  }
 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   if (null == convertView || null == convertView.getTag()) {
     holder = new ViewHolder();
     convertView = LayoutInflater.from(context).inflate(R.layout.list_item_message, parent, false);
     holder.name = (TextView) convertView.findViewById(R.id.message_contacts_lv_item_name);
     holder.otherPeopleName =
         (TextView) convertView.findViewById(R.id.message_contacts_lv_item_other_name);
     holder.content = (TextView) convertView.findViewById(R.id.message_contacts_lv_item_content);
     holder.data = (TextView) convertView.findViewById(R.id.message_contacts_lv_item_data);
     holder.tag = (ImageView) convertView.findViewById(R.id.message_contacts_lv_item_tag);
     holder.city = (CountryImageView) convertView.findViewById(R.id.message_contacts_lv_item_city);
     holder.rlItemCity =
         (RelativeLayout) convertView.findViewById(R.id.message_contacts_rl_item_city);
     holder.attachment =
         (ImageView) convertView.findViewById(R.id.message_contacts_lv_item_attachment);
     holder.isRead = (ImageView) convertView.findViewById(R.id.message_contacts_lv_item_read);
     holder.rlTag =
         (RelativeLayout) convertView.findViewById(R.id.message_contacts_lv_item_rl_tag);
     holder.rlTagPadding =
         (View) convertView.findViewById(R.id.message_contacts_lv_item_left_padding);
     convertView.setTag(holder);
   } else {
     holder = (ViewHolder) convertView.getTag();
   }
   messageContent = (MessageContent) getItem(position);
   if ("0".equals(action)) {
     holder.isRead.setVisibility(View.GONE);
     fullName = messageContent.sender.fullName;
     otherNameTag = "收件人:";
     if ("00".equals(messageContent.receiver.operatorId)
         || !SupplierApplication.getInstance().getUser().content.userInfo.isManager()) {
       otherName = "我";
       otherNameColor = context.getResources().getColor(R.color.color_b3b3b3);
     } else {
       otherName = messageContent.receiver.fullName;
       otherNameColor = context.getResources().getColor(R.color.color_ccb895);
     }
     if (!Utils.isEmpty(messageContent.sender.countryImageUrl)) {
       holder.rlItemCity.setVisibility(View.VISIBLE);
       ImageUtil.getImageLoader()
           .displayImage(
               messageContent.sender.countryImageUrl,
               holder.city,
               ImageUtil.getCommonImageOptions());
     } else {
       holder.rlItemCity.setVisibility(View.INVISIBLE);
     }
     if ("0".equals(messageContent.isRead)) // true:未读
     {
       holder.name.setTextColor(context.getResources().getColor(R.color.color_333333));
       holder.tag.setImageResource(R.drawable.bg_message_blue_dot);
       holder.tag.setVisibility(View.VISIBLE);
     } else {
       // 判断是否已经回复
       if ("1".equals(messageContent.isReplied)) {
         holder.tag.setImageResource(R.drawable.ic_message_reply);
         holder.tag.setVisibility(View.VISIBLE);
       } else {
         holder.tag.setVisibility(View.INVISIBLE);
       }
       holder.name.setTextColor(context.getResources().getColor(R.color.color_666666));
     }
   } else {
     holder.rlTag.setVisibility(View.GONE);
     holder.rlTagPadding.setVisibility(View.VISIBLE);
     if ("1".equals(messageContent.receiverReadFlag)) // true:未读
     {
       holder.name.setTextColor(context.getResources().getColor(R.color.color_666666));
       holder.isRead.setVisibility(View.VISIBLE);
     } else {
       holder.name.setTextColor(context.getResources().getColor(R.color.color_333333));
       holder.isRead.setVisibility(View.GONE);
     }
     fullName = messageContent.receiver.fullName;
     otherNameTag = "发件人:";
     if ("00".equals(messageContent.sender.operatorId)
         || !SupplierApplication.getInstance().getUser().content.userInfo.isManager()) {
       otherName = "我";
       otherNameColor = context.getResources().getColor(R.color.color_b3b3b3);
     } else {
       otherName = messageContent.sender.fullName;
       otherNameColor = context.getResources().getColor(R.color.color_ccb895);
     }
     holder.rlItemCity.setVisibility(View.GONE);
     holder.tag.setVisibility(View.GONE);
   }
   if ("1".equals(messageContent.isAttached)) {
     holder.attachment.setVisibility(View.VISIBLE);
   } else {
     holder.attachment.setVisibility(View.GONE);
   }
   holder.otherPeopleName.setText(otherNameTag + otherName);
   holder.otherPeopleName.setTextColor(otherNameColor);
   holder.name.setText(fullName);
   if (!Utils.isEmpty(messageContent.date)) {
     holder.data.setText(Util.formatDateForMessageList(messageContent.date));
     holder.data.setVisibility(View.VISIBLE);
   } else {
     holder.data.setVisibility(View.INVISIBLE);
   }
   holder.content.setText(messageContent.subject);
   return convertView;
 }
 @Override
 public void onSuccess(Object result) {
   SupplierApplication.getInstance().setUser((User) result);
   RequestCenter.boundAccount(new SimpleDisposeDataListener(), true);
 }