protected static void dismiss(final View dialogView) {
        if (dialogView == null) {
            return;
        }
        final BaseDialog baseDialog = (BaseDialog) dialogView.getTag();
        log(baseDialog.dialogKey() + ".dismiss");
        removeDialogToRunningList(baseDialog);
        if (baseDialog.dialogView != null) {
            baseDialog.dialogView.clear();
        }
        baseDialog.onDialogDismiss();
        switch (baseDialog.dialogImplMode) {
            case WINDOW:
                WindowUtil.dismiss(dialogView);
                break;
            case DIALOG_FRAGMENT:
                if (baseDialog.ownDialogFragmentImpl != null && baseDialog.ownDialogFragmentImpl.get() != null) {
                    baseDialog.ownDialogFragmentImpl.get().dismiss();
                }
                break;
            case FLOATING_ACTIVITY:
                if (baseDialog.floatingWindowActivity != null && baseDialog.floatingWindowActivity.get() != null) {
                    FrameLayout rootView = getDecorView(baseDialog.floatingWindowActivity.get());
                    if (rootView != null) {
                        rootView.removeView(dialogView);
                    }
                    baseDialog.floatingWindowActivity.get().finish(baseDialog.dialogKey());
                    requestDialogFocus();
                }
                break;
            default:
                runOnMain(new Runnable() {
                    @Override
                    public void run() {
                        if (dialogView.getParent() == null || !(dialogView.getParent() instanceof ViewGroup)) {
                            if (baseDialog.getRootFrameLayout() == null) {
                                return;
                            }
                            baseDialog.getRootFrameLayout().removeView(dialogView);
                        } else {
                            ((ViewGroup) dialogView.getParent()).removeView(dialogView);
                        }
                        requestDialogFocus();
                    }
                }, true);
                break;
        }
        if (baseDialog.getDialogListBuilder() != null) {
            if (baseDialog.getDialogListBuilder().isEmpty()) {
                baseDialog.cleanDialogList();
            } else {
                baseDialog.getDialogListBuilder().showNext();
            }
        }
    }
@author: Kongzue
@github: https://github.com/kongzue/
@homepage: http://kongzue.com/
@mail: myzcxhh@live.cn
@createTime: 2020/9/22 14:10
DialogX/src/main/java/com/kongzue/dialogx/interfaces/BaseDialog.java