@Override
                        public boolean onPreDraw() {
                            int[] baseViewLocCache = new int[2];
                            if (baseView() != null) {
                                baseView().getLocationInWindow(baseViewLocCache);
                                if (getDialogImpl() != null && isShow && baseView().getVisibility() == View.VISIBLE) {
                                    if (baseViewLocCache[0] != 0) {
                                        baseViewLoc[0] = baseViewLocCache[0];
                                    }
                                    if (baseViewLocCache[1] != 0) {
                                        baseViewLoc[1] = baseViewLocCache[1];
                                    }
                                    onLayoutChangeRunnable.run();
                                }
                            } else {
                                removeDrawListener(viewTreeObserver, this);
                                viewTreeObserver = null;
                                baseViewDrawListener = null;
                            }
                            return true;
                        }
@author: Kongzue
@github: https://github.com/kongzue/
@homepage: http://kongzue.com/
@mail: myzcxhh@live.cn
@createTime: 2020/10/20 11:59
DialogX/src/main/java/com/kongzue/dialogx/dialogs/CustomDialog.java