Skip to content

Instantly share code, notes, and snippets.

@cutiko
Last active July 25, 2018 15:33
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cutiko/348d5dee496d7abfd022d8a2e81ec812 to your computer and use it in GitHub Desktop.
Save cutiko/348d5dee496d7abfd022d8a2e81ec812 to your computer and use it in GitHub Desktop.
Android Dialogs Cheat Sheet
/*CUSTOM LAYOUT*/
Dialog dialog = new Dialog(context);
dialog.setContentView(R.layout.dialog_background_primary_dark);
//Then to find a view inside the custom layout use the dialog as root view
EditText inputEt = (EditText) dialog.findViewById(R.id.inputEt);
/*FULLSCREEN*/
//The style below can be replaced by any fullscreen style, you can create a fullscreen activity and use that style
Dialog fullScreen = new Dialog(context, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
/*FULLWIDTH*/
Dialog fullWidth = new Dialog(context);
fullWidth.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
/*NO TITLE*/
Dialog dialog = new Dialog(context);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
@cutiko
Copy link
Author

cutiko commented Jul 27, 2016

@cutiko
Copy link
Author

cutiko commented May 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment