class ReceiveTransactionPresenter extends BasePresenter<ReceiveTransationContract.View> implements ReceiveTransationContract.Presenter {

    @Override
    public void shareView() {
        if (mQRCodeBitmap == null || walletEntity == null) {
            return;
        }
        String text = walletEntity.getPrefixAddress();
        View shareView = getView().shareView(walletEntity.getName(), text, mQRCodeBitmap);
        final BaseActivity activity = currentActivity();

        DirectroyController.getInstance().getDir(activity, DirType.image, new DirectroyController.DirCallback() {
            @Override
            public void callback(File dir) {
                if (dir != null) {
                    Bitmap shareBitmap = screenShot(shareView);
                    boolean saved = PhotoUtil.saveImageToAlbum(activity, dir, getImageName(), shareBitmap);
                    if (saved) {
                        ToastUtil.showLongToast(activity, activity.getResources().getString(R.string.save_image_tips));
                       // showLongToast(R.string.save_image_tips);
                        List<ShareAppInfo> shareAppInfoList = Arrays.asList(ShareAppInfo.values());
                        if (!shareAppInfoList.isEmpty()) {
                            ShareDialogFragment.newInstance(new ArrayList<>(shareAppInfoList))
                                    .setOnShareItemClickListener(new ShareDialogFragment.OnShareItemClickListener() {
                                        @Override
                                        public void onShareItemClick(BaseDialogFragment dialogFragment, ShareAppInfo shareAppInfo) {
                                            dialogFragment.dismiss();
                                            shareAppInfo.share(currentActivity(), shareBitmap, new UMShareListener() {
                                                @Override
                                                public void onStart(SHARE_MEDIA share_media) {
                                                    showLoadingDialog();
                                                }

                                                @Override
                                                public void onResult(SHARE_MEDIA share_media) {
                                                    dismissLoadingDialogImmediately();
                                                    showLongToast(R.string.msg_share_success);
                                                }

                                                @Override
                                                public void onError(SHARE_MEDIA share_media, Throwable throwable) {
                                                    dismissLoadingDialogImmediately();
                                                    showLongToast(R.string.msg_share_failed);
                                                }

                                                @Override
                                                public void onCancel(SHARE_MEDIA share_media) {
                                                    dismissLoadingDialogImmediately();
                                                    showLongToast(R.string.msg_share_cancelled);
                                                }
                                            });
                                        }
                                    })
                                    .show(activity.getSupportFragmentManager(), "showShareDialogFragment");
                        }
                    } else {
                        showShortToast(R.string.save_image_failed_tips);
                    }
                }
            }
        });


    }

}