Skip to content

Instantly share code, notes, and snippets.

@seemike
Created October 9, 2013 11:06
Show Gist options
  • Save seemike/6899579 to your computer and use it in GitHub Desktop.
Save seemike/6899579 to your computer and use it in GitHub Desktop.
android dialog attributes - modal, dim background, notitle
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Dialog dialog = super.onCreateDialog(savedInstanceState);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
//set the dialog to non-modal and disable dim out fragment behind
Window window = dialog.getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
//blur out the background
//window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
window.getAttributes().windowAnimations = R.style.dialog_animation;
return dialog;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment