Kevin
Kevin

Reputation: 712

what's the "default" theme for (Progress)Dialogs in android?

I can create a ProgressDialog like this:

ProgressDialog progressDialog = new ProgressDialog(this);
progressDialog.setMessage("Hi");
progressDialog.setIndeterminate(true);
progressDialog.show();

Looks great, but I want to change a couple aspects - and only a couple aspects - of the ProgressDialog that is created using the code above. Everything else should remain the same.

Let's say I want to change the text color and disable the background dimming. I know I can do this programmatically, but I'd like to use a custom defined style. I can then apply that style:

ProgressDialog progressDialog = new ProgressDialog(this, R.style.MyProgressDialogStyle);
...

So the question is, what should I use as the parent, such that the "default" style being used on the device is unchanged? Obviously I want the solution to be portable so that it works on all devices.

<style name="MyProgressDialogStyle" parent=?????>
    <item name="android:backgroundDimEnabled">false</item>
    <item name="android:textColor">@color/my_color</item>
</style>

All answers I've seen so far seem to use different themes as the parent. Does that mean that there's no real way to achieve what I'm looking for? Is using a style the wrong approach in this case?

Upvotes: 1

Views: 362

Answers (1)

Ch4t4r
Ch4t4r

Reputation: 1407

You properly want to use Theme.AppCompat.Light.Dialog.Alert

Upvotes: 1

Related Questions