FinalView view = Layoutinflater.from (context). Inflate (LayoutID,NULL); FinalDialog Dialog =NewDialog (context, r.style.style_dialog); Dialog.setcontentview (view); Dialog.show (); Window Window=Dialog.getwindow (); Window.setgravity (Gravity.bottom); Window.setwindowanimations (r.style.dialog_animation); Window.getdecorview (). setpadding (0, 0, 0, 0); Windowmanager.layoutparams LP=window.getattributes (); Lp.width=WindowManager.LayoutParams.MATCH_PARENT; Lp.height=WindowManager.LayoutParams.WRAP_CONTENT; Window.setattributes (LP);
Style_dialog:
<style name= "Style_dialog" parent= "Android:style/theme.dialog" > <item name= "Android:windowbackground "> @color/white</item> <item name=" Android:windownotitle ">true</item> < Item Name= "Android:windowisfloating" >true</item> <item name= "Android: Windowcontentoverlay ">@null</item> <item name=" android:scrollhorizontally "> True</item> </style>
Dialog_animation:
<style name= "Dialog_animation" > <item name= "android:windowenteranimation" > @anim/enter</item > <item name= "android:windowexitanimation" > @anim/exit</item> </style>
Enter
<?xml version= "1.0" encoding= "Utf-8"? ><set xmlns:android= "Http://schemas.android.com/apk/res/android" Android:shareinterpolator= "false" > <translate android:fromydelta= "100%p" Android:toydelta= "0" android:duration= "/></set>"
Exit
<?xml version= "1.0" encoding= "Utf-8"? ><set xmlns:android= "Http://schemas.android.com/apk/res/android" Android:shareinterpolator= "false" > <translate android:fromydelta= "0" Android:toydelta= "100%p" android:duration= "All" /></set>
Android Popup dialog Box dialog full screen width