title: Android full screen dialog fragment like calendar app
body: <p>I am trying to achieve a full-screen dialog like the below image. I am able to show a full screen dialog but when the dialog is shown the status bar color changes to black and does not keep the primary-dark color.</p>
  
  <p>Heres my dialog fragment</p>
  
  <pre><code>public class IconsDialogFragment extends DialogFragment {
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
          // Inflate the layout to use as dialog or embedded fragment
          return inflater.inflate(R.layout.fragment_icons_dialog, container, false);
      }
  
      @Override
      public Dialog onCreateDialog(Bundle savedInstanceState) {
  
          final RelativeLayout root = new RelativeLayout(getActivity());
          root.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
  
          // creating the fullscreen dialog
          final Dialog dialog = new Dialog(getActivity());
          dialog.setContentView(root);
          dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.YELLOW));
          dialog.getWindow().setWindowAnimations(R.style.DialogAnimation);
          dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
  
          return dialog;
      }
  
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Xol6F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Xol6F.png" alt="enter image description here"></a></p>