Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ahmedyehya92/44bd3b6f36f532238796d7e8c4efb033 to your computer and use it in GitHub Desktop.
Save ahmedyehya92/44bd3b6f36f532238796d7e8c4efb033 to your computer and use it in GitHub Desktop.
Full screen dialog fragment
@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
// the content
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.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(root);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.WHITE));
dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
return dialog;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment