I made a new way without having a background drawable is that make it have CardView as parent and give it a app:cardCornerRadius="20dp"
and then add this in the java class dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
It's another way to make it .