private void processLogic(Bundle savedInstanceState) {
    mSaveImgDir = (File) getIntent().getSerializableExtra(EXTRA_SAVE_IMG_DIR);
    if (mSaveImgDir == null) {
      mDownloadIv.setVisibility(View.INVISIBLE);
    }

    mPreviewImages = getIntent().getStringArrayListExtra(EXTRA_PREVIEW_IMAGES);

    mIsSinglePreview = getIntent().getBooleanExtra(EXTRA_IS_SINGLE_PREVIEW, false);
    if (mIsSinglePreview) {
      mPreviewImages = new ArrayList<>();
      mPreviewImages.add(getIntent().getStringExtra(EXTRA_PHOTO_PATH));
    }

    int currentPosition = getIntent().getIntExtra(EXTRA_CURRENT_POSITION, 0);
    mContentHvp.setAdapter(new ImagePageAdapter());
    mContentHvp.setCurrentItem(currentPosition);

    // 处理第一次进来时指示数字
    renderTitleTv();

    // 过2秒隐藏标题栏
    mTitleRl.postDelayed(
        new Runnable() {
          @Override
          public void run() {
            hiddenTitlebar();
          }
        },
        2000);
  }
 private void renderTitleTv() {
   if (mIsSinglePreview) {
     mTitleTv.setText(MQResUtils.getResStringID("mq_view_photo"));
   } else {
     mTitleTv.setText((mContentHvp.getCurrentItem() + 1) + "/" + mPreviewImages.size());
   }
 }
  private void initListener() {
    findViewById(MQResUtils.getResIdID("back_iv")).setOnClickListener(this);
    mDownloadIv.setOnClickListener(this);

    mContentHvp.addOnPageChangeListener(
        new ViewPager.SimpleOnPageChangeListener() {
          @Override
          public void onPageSelected(int position) {
            renderTitleTv();
          }
        });
  }
  private synchronized void savePic() {
    if (mSavePhotoTask != null) {
      return;
    }

    final String url = mPreviewImages.get(mContentHvp.getCurrentItem());
    File file;
    if (url.startsWith("file")) {
      file = new File(url.replace("file://", ""));
      if (file.exists()) {
        MQUtils.showSafe(
            MQPhotoPreviewActivity.this,
            getString(
                MQResUtils.getResStringID("mq_save_img_success_folder"),
                file.getParentFile().getAbsolutePath()));
        return;
      }
    }

    // 通过MD5加密url生成文件名,避免多次保存同一张图片
    file = new File(mSaveImgDir, MQUtils.stringToMD5(url) + ".png");
    if (file.exists()) {
      MQUtils.showSafe(
          this,
          getString(
              MQResUtils.getResStringID("mq_save_img_success_folder"),
              mSaveImgDir.getAbsolutePath()));
      return;
    }

    mSavePhotoTask = new MQSavePhotoTask(this, this, file);
    MQImage.downloadImage(
        this,
        url,
        new MQImageLoader.MQDownloadImageListener() {
          @Override
          public void onSuccess(String url, Bitmap bitmap) {
            mSavePhotoTask.setBitmapAndPerform(bitmap);
          }

          @Override
          public void onFailed(String url) {
            mSavePhotoTask = null;
            MQUtils.showSafe(
                MQPhotoPreviewActivity.this, MQResUtils.getResStringID("mq_save_img_failure"));
          }
        });
  }