First, the way XML is implemented
<style name= "Circular_dialog" parent= "@android: Style/theme.dialog" > <item name= "Android:windowframe" > @null </item><!--have borderless--<item name= "android:windowisfloating" >true</item><!--suspended in act Ivity--<item name= "android:windowistranslucent" >false</item><!--Translucent-to-<item Name= "Android:windownotitle" >true</item><!--set with untitled--<item name= "Android:windowbackground" ; @android:color/transparent</item><!--Set Background transparency--<item name= "android:backgrounddimenabled" >fa lse</item><!--Setting whether the background is blurry-<item name= "Android:backgrounddimamount" >0.6</item><!--Grayscale --<item name= "Android:windowcontentoverlay" > @null </item><!--dialog box is shaded--<item n Ame= "Android:windowanimationstyle" > @style/dialog_animation</item>< Animation effect!--pop-up or entry-<item nam E= "Android:colorbackgroundCachehint "> @null </item><!--Background Cache color-<item name=" Android:background "> @android: Color/transpa Rent</item> <!--system transparent??? -
</style>
Use
Dialog = New dialog (context, R.style.circular_dialog);
Dialog.setcontentview (R.layout.progress_dialog);
Second, with the implementation of code
Dialog = New dialog (context);
Probar = new ProgressBar (context,null,android. R.attr.progressbarstylelarge);
Layout = new LinearLayout (context);
Layout.addview (probar,new layoutparams (layoutparams.fill_parent,layoutparams.fill_parent));
Dialog.requestwindowfeature (Window.feature_no_title);
Dialog.getwindow (). Setbackgrounddrawableresource (r.color.transparent);
Dialog.setcontentview (layout);
Dialog setting Translucent effects