@Override
                        public void run() {
                            int baseViewLeft = baseViewLoc[0] - (int) boxRoot.getX();
                            int baseViewTop = baseViewLoc[1] - (int) boxRoot.getY();
                            int calX = 0, calY = 0;
                            if (alignViewGravity != -1) {
                                if (isAlignBaseViewGravity(Gravity.CENTER_VERTICAL)) {
                                    calY = (baseViewTop + baseView().getMeasuredHeight() / 2 - boxCustom.getHeight() / 2);
                                }
                                if (isAlignBaseViewGravity(Gravity.CENTER_HORIZONTAL)) {
                                    calX = (baseViewLeft + baseView().getMeasuredWidth() / 2 - boxCustom.getWidth() / 2);
                                }
                                if (isAlignBaseViewGravity(Gravity.CENTER)) {
                                    calX = (baseViewLeft + baseView().getMeasuredWidth() / 2 - boxCustom.getWidth() / 2);
                                    calY = (baseViewTop + baseView().getMeasuredHeight() / 2 - boxCustom.getHeight() / 2);
                                }

                                if (isAlignBaseViewGravity(Gravity.TOP)) {
                                    calY = baseViewTop - boxCustom.getHeight() - marginRelativeBaseView[3];
                                }
                                if (isAlignBaseViewGravity(Gravity.LEFT)) {
                                    calX = baseViewLeft - boxCustom.getWidth() - marginRelativeBaseView[2];
                                }
                                if (isAlignBaseViewGravity(Gravity.RIGHT)) {
                                    calX = baseViewLeft + baseView().getWidth() + marginRelativeBaseView[0];
                                }
                                if (isAlignBaseViewGravity(Gravity.BOTTOM)) {
                                    calY = baseViewTop + baseView().getHeight() + marginRelativeBaseView[1];
                                }
                                int widthCache = width == 0 ? baseView().getWidth() : width;
                                int heightCache = height == 0 ? baseView().getHeight() : height;
                                baseViewLoc[2] = widthCache > 0 ? widthCache : baseViewLoc[2];
                                baseViewLoc[3] = heightCache > 0 ? heightCache : baseViewLoc[3];

                                if (calX != 0 && calX != boxCustom.getX()) boxCustom.setX(calX);
                                if (calY != 0 && calY != boxCustom.getY()) boxCustom.setY(calY);

                                onGetBaseViewLoc(baseViewLoc);
                            }
                        }
@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