if (window != null) {
            window.setBackgroundDrawableResource(R.drawable.custom_dialog_background);

            window.getDecorView().post(() -> {
                DisplayMetrics displayMetrics = new DisplayMetrics();