Dialog Progress Opaque White Background

Asked

Viewed 136 times

2

I’ve been trying for a few days to reach a transparent Progress dialog with an opaque white background equal to the images below but only get to black background opaque in the android pattern I’ve seen some apps that managed to do so someone already got ? if you could help me how ? I thank you from now on for the help of all.

public static Dialog showDialogLoading(Context context, String msg) {
    Dialog dialog = new Dialog(context, R.style.AppThemeLoading);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.progress_dialog);
    dialog.getWindow().setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(context, R.color.corBranco_dialog)));
    dialog.show();
    return dialog;
}

<style name="AppThemeLoading" parent="Base.ThemeOverlay.AppCompat">
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:colorBackgroundCacheHint">@null</item>
</style>

<color name="corBranco_dialog">#80ffffff</color>

print tirado do app Wish dialog loading transparente com fundo branco print tirado do app do PagSeguro dialog loading transparente com fundo branco

  • To do this you will have to set the color Alpha

  • Post your code so we can see how you’re doing

  • @Raonibz edited the question adding the code can give a help now, I’m still learning to use stackoverflow

  • Try it this way: dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.R.color.transparent)); If it works, then you create a reference color, and change only (android.R.color.suacor).

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.