public PopMenu show(Activity activity) {
        if (isHide && getDialogView() != null && isShow) {
            if (hideWithExitAnim && getDialogImpl() != null) {
                getDialogImpl().boxBody.clearAnimation();
                getDialogView().setVisibility(View.VISIBLE);
                getDialogImpl().boxRoot.animate().alpha(1f);
                getDialogImpl().getDialogXAnimImpl().doShowAnim(me, getDialogImpl().boxBody);
            } else {
                getDialogView().setVisibility(View.VISIBLE);
            }
            return this;
        }

        super.beforeShow();
        if (getDialogView() == null) {
            int layoutId = isLightTheme() ? R.layout.layout_dialogx_popmenu_material : R.layout.layout_dialogx_popmenu_material_dark;
            if (getStyle().popMenuSettings() != null) {
                if (getStyle().popMenuSettings().layout(isLightTheme()) != 0) {
                    layoutId = getStyle().popMenuSettings().layout(isLightTheme());
                }
            }

            View dialogView = createView(layoutId);
            dialogImpl = new DialogImpl(dialogView);
            if (dialogView != null) {
                dialogView.setTag(me);
            }
            show(activity, dialogView);
        } else {
            show(activity, getDialogView());
        }
        if (baseView() != null) {
            viewTreeObserver = baseView().getViewTreeObserver();
            viewTreeObserver.addOnDrawListener(baseViewDrawListener = new ViewTreeObserver.OnDrawListener() {
                @Override
                public void onDraw() {
                    int[] baseViewLocCache = new int[2];
                    if (baseView() != null) {
                        baseView().getLocationInWindow(baseViewLocCache);
                        if (getDialogImpl() != null && !baseViewLoc.isSameLoc(baseViewLocCache) && baseView().getVisibility() == VISIBLE) {
                            baseViewLoc.set(baseViewLocCache);
                            refreshMenuLoc();
                        }
                    } else {
                        if (viewTreeObserver != null) {
                            removeDrawListener(viewTreeObserver, this);
                            viewTreeObserver = null;
                            baseViewDrawListener = null;
                        }
                    }
                }
            });
        }
        return this;
    }
@author: Kongzue
@github: https://github.com/kongzue/
@homepage: http://kongzue.com/
@mail: myzcxhh@live.cn
@createTime: 2021/8/18 14:27
DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopMenu.java