Color Spinner Progressdialog - Android

Asked

Viewed 449 times

1

How do I change the default color of Progressdialog (Spinner) on android? Below is the code I’m using:

ProgressDialog progress = new ProgressDialog(this);
        progress.setTitle("Título);
        progress.setMessage("Mensagem");
        progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        progress.show();

2 answers

3


I solved the problem with the following code:

I added a layout for my Progressdialog

progress = new ProgressDialog(this, R.style.styleProgressDialog);

And I customized the colors in my style as follows:

<style name="styleProgressDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
    <item name="android:tint">@color/colorPrimary</item>
    <item name="android:textSize">12dp</item>
</style>

0

You need to change the property progressTint with the color you want.

You can do this directly in the xml of your layout or via code:

progress.setProgressTintList(ColorStateList.valueOf(Color.RED));
  • Is that the setProgressTintList would be for the use of Progressbar, I am using the Progressdialog...

  • This might help: http://stackoverflow.com/questions/13910028/using-custom-progressdialog-android

Browser other questions tagged

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