예제 #1
0
 @Override
 public boolean updateMessageInfo(Context context, List<MessageInfoModel> list) {
   boolean result = true;
   if (BeanUtils.isNotEmpty(list)) {
     for (MessageInfoModel info : list) {
       boolean subResult = updateMessageInfo(context, info);
       if (!subResult) {
         result = false;
       }
     }
   }
   return result;
 }
  /** 更新卸货地址信息 */
  private void updateUI() {
    if (info != null) {
      if (StringUtils.isNEmpty(info.areaName)) {
        mTvAddrDetail1.setText(getString(R.string.data_empty));
      } else {
        mTvAddrDetail1.setText(info.areaName);
      }
      if (StringUtils.isNEmpty(info.deliveryAddrDetail)) {
        mTvAddrDetail2.setText(getString(R.string.data_empty));
      } else {
        mTvAddrDetail2.setText(info.deliveryAddrDetail);
      }
      mItemPortWaterDepth.setContentText(
          info.uploadPortWaterDepth != 0
              ? String.valueOf(info.uploadPortWaterDepth)
              : getString(R.string.data_empty));
      mItemPortShipTon.setContentText(
          info.shippingTon != 0
              ? String.valueOf(info.shippingTon)
              : getString(R.string.data_empty));

      List<ImageInfoModel> imgUrl = info.addrImageList;
      if (BeanUtils.isEmpty(imgUrl)) {
        getView(R.id.item_devider_discharge_addr).setVisibility(View.GONE);
        getView(R.id.ll_addr_pic).setVisibility(View.GONE);
      } else {
        getView(R.id.item_devider_discharge_addr).setVisibility(View.VISIBLE);
        getView(R.id.ll_addr_pic).setVisibility(View.VISIBLE);
        int count = imgUrl.size();
        if (count >= 1) {
          mIvItemAddrPic1.setVisibility(View.VISIBLE);
          ImageLoaderManager.getIntance()
              .display(
                  this,
                  imgUrl.get(0) != null ? imgUrl.get(0).cloudThumbnailUrl : "",
                  mIvItemAddrPic1,
                  IMAGE_DEFAULT,
                  IMAGE_FAILED);
        }
        if (count >= 2) {
          mIvItemAddrPic2.setVisibility(View.VISIBLE);
          ImageLoaderManager.getIntance()
              .display(
                  this,
                  imgUrl.get(1) != null ? imgUrl.get(1).cloudThumbnailUrl : "",
                  mIvItemAddrPic2,
                  IMAGE_DEFAULT,
                  IMAGE_FAILED);
        } else {
          mIvItemAddrPic2.setVisibility(View.INVISIBLE);
        }
        if (count >= 3) {
          mIvItemAddrPic3.setVisibility(View.VISIBLE);
          ImageLoaderManager.getIntance()
              .display(
                  this,
                  imgUrl.get(2) != null ? imgUrl.get(2).cloudThumbnailUrl : "",
                  mIvItemAddrPic3,
                  IMAGE_DEFAULT,
                  IMAGE_FAILED);
        } else {
          mIvItemAddrPic3.setVisibility(View.INVISIBLE);
        }
      }
    }
  }