Пример #1
0
 private void goPage(HomePhotoInfo homePhotoInfo) {
   if (Constant.isSDCardPresent) {
     if (homePhotoInfo.getType() == HomePhotoInfo.EVENT_PIC) {
       CameraGalleryActivity_.intent(this).eventOrPhoto(HomePhotoInfo.EVENT_PIC).start();
     } else {
       CameraGalleryActivity_.intent(this).eventOrPhoto(HomePhotoInfo.NORMAL_PIC).start();
     }
   } else {
     showToastSafe(getResources().getString(R.string.idcard_loss));
   }
 }
Пример #2
0
  @UiThread
  void showPhoto() {
    if (homePhotoInfos.size() > 0) {
      showOrHideTip(false);
    } else {
      showOrHideTip(true);
      return;
    }
    needRefreshPhoto(homePhotoInfos.size());
    if (homePhotoInfos.size() == 1) {
      HomePhotoInfo hPI1 = homePhotoInfos.get(0);
      Glide.with(this)
          .load(hPI1.getPath())
          .placeholder(R.drawable.img_default)
          .crossFade()
          .into(iv_first);
      tv_first_text.setText(hPI1.getName());
      if (hPI1.getType() == HomePhotoInfo.EVENT_PIC) {
        iv_first_icon.setVisibility(View.VISIBLE);
      } else {
        iv_first_icon.setVisibility(View.GONE);
      }

    } else if (homePhotoInfos.size() == 2) {
      HomePhotoInfo hPI1 = homePhotoInfos.get(0);
      HomePhotoInfo hPI2 = homePhotoInfos.get(1);
      Glide.with(this)
          .load(hPI1.getPath())
          .placeholder(R.drawable.img_default)
          .crossFade()
          .into(iv_first);
      Glide.with(this)
          .load(hPI2.getPath())
          .placeholder(R.drawable.img_default)
          .crossFade()
          .into(iv_two);
      tv_first_text.setText(hPI1.getName());
      tv_two_text.setText(hPI2.getName());
      if (hPI1.getType() == HomePhotoInfo.EVENT_PIC) {
        iv_first_icon.setVisibility(View.VISIBLE);
      } else {
        iv_first_icon.setVisibility(View.GONE);
      }
      if (hPI2.getType() == HomePhotoInfo.EVENT_PIC) {
        iv_two_icon.setVisibility(View.VISIBLE);
      } else {
        iv_two_icon.setVisibility(View.GONE);
      }
    } else if (homePhotoInfos.size() >= 3) {
      HomePhotoInfo hPI1 = homePhotoInfos.get(0);
      HomePhotoInfo hPI2 = homePhotoInfos.get(1);
      HomePhotoInfo hPI3 = homePhotoInfos.get(2);
      Glide.with(this)
          .load(hPI1.getPath())
          .placeholder(R.drawable.img_default)
          .crossFade()
          .into(iv_first);
      Glide.with(this)
          .load(hPI2.getPath())
          .placeholder(R.drawable.img_default)
          .crossFade()
          .into(iv_two);
      Glide.with(this)
          .load(hPI3.getPath())
          .placeholder(R.drawable.img_default)
          .crossFade()
          .into(iv_three);
      tv_first_text.setText(hPI1.getName());
      tv_two_text.setText(hPI2.getName());
      tv_three_text.setText(hPI3.getName());
      if (hPI1.getType() == HomePhotoInfo.EVENT_PIC) {
        iv_first_icon.setVisibility(View.VISIBLE);
      } else {
        iv_first_icon.setVisibility(View.GONE);
      }
      if (hPI2.getType() == HomePhotoInfo.EVENT_PIC) {
        iv_two_icon.setVisibility(View.VISIBLE);
      } else {
        iv_two_icon.setVisibility(View.GONE);
      }
      if (hPI3.getType() == HomePhotoInfo.EVENT_PIC) {
        iv_three_icon.setVisibility(View.VISIBLE);
      } else {
        iv_three_icon.setVisibility(View.GONE);
      }
    }
  }