1This below answer works for me in fragment dialog.
2
3
4 Dialog dialog = getDialog();
5 if (dialog != null)
6 {
7 int width = ViewGroup.LayoutParams.MATCH_PARENT;
8 int height = ViewGroup.LayoutParams.MATCH_PARENT;
9 dialog.getWindow().setLayout(width, height);
10 }
1override fun onStart() {
2 super.onStart()
3 dialog?.let {
4 val width = ViewGroup.LayoutParams.MATCH_PARENT
5 val height = ViewGroup.LayoutParams.MATCH_PARENT
6 it.window?.setLayout(width, height)
7 }
8}