1. Set the Transparency (dialog own transparency)
Windowmanager.layoutparams Lp=dialog.getwindow (). GetAttributes ();
lp.alpha=1.0f;
Dialog.getwindow (). SetAttributes (LP);
Alpha is between 0.0f and 1.0f. 1.0 completely opaque, 0.0f completely transparent
2. Set the Darkness (dialog's own dark degree)
Dialog.setcontentview (R.layout.dialog);
Windowmanager.layoutparams Lp=dialog.getwindow (). GetAttributes ();
lp.dimamount=1.0f;
Dialog.getwindow (). SetAttributes (LP);
Dialog.getwindow (). Addflags (WindowManager.LayoutParams.FLAG_DIM_BEHIND);
Dimamount between 0.0f and 1.0f, 0.0f completely dim, 1.0f full Dark
3. Set the background blur and darkness of the dialog
WindowManager.LayoutParams.FLAG_BLUR_BEHIND (set Blur)
WindowManager.LayoutParams.FLAG_DIM_BEHIND (Dim setting)
4. Clear the background blur and darkness of the dialog
Getdialog (). GetWindow (). Clearflags (WindowManager.LayoutParams.FLAG_BLUR_BEHIND | WindowManager.LayoutParams.FLAG_DIM_BEHIND)
Android Settings dialog transparency, how to dark degrees