1, first step: Style Style.xml code
<?XML version= "1.0" encoding= "Utf-8"?><Resources>// <stylename= "dialog"Parent= "@android: Style/theme.dialog"> <Itemname= "Android:windowframe">@null</Item><!--Border - <Itemname= "Android:windowisfloating">True</Item><!--is it on the activity ? - <Itemname= "Android:windowistranslucent">False</Item><!--Translucent - <Itemname= "Android:windownotitle">True</Item><!--No title - <Itemname= "Android:windowbackground">@color/transparent</Item><!--Transparent Background - <Itemname= "android:backgrounddimenabled">False</Item><!--Blur-
<item name="android:layoutanimation" > @null</item>//dialog popup without animation
</style>
</ Resources >
Mdialog =NewDialog (Context,r.style. Dialog); Mdialog.setcontentview (r.layout.dialog_layout); Mdialog.setcanceledontouchoutside (true); Windowmanager.layoutparams params=Mdialog.getwindow (). GetAttributes (); Params.gravity= Gravity.top;//This setting causes the dialog to bounce from above.Params.windowanimations = 1; WindowManager Manager=(WindowManager) Context.getsystemservice (Context.window_service); Display Display=Manager.getdefaultdisplay (); WindowHeight=display.getheight (); WindowWidth=display.getwidth (); Params.width=WindowWidth; Params.height=WindowHeight; /*Mdialog.findviewbyid (R.id.right_button). Setonclicklistener (New View.onclicklistener () {@Override public V OID OnClick (View v) {Mdialog.dismiss (); } }); Mdialog.findviewbyid (R.ID.DROPDOWNBCKGRND). Setonclicklistener (New View.onclicklistener () {@Override public void OnClick (View v) {Mdialog.dismiss (); } });*/
Dialog Custom Use