Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android AppCompat ProgressDialog?

Tags:

I want to style all the android.app.ProgressDialogs in my app on pre-Lollipop versions to make them look like Material Design.

Maybe I'm missing something obvious: I'm looking for android.support.v7.app.ProgressDialog, but there is no such class in Android AppCompat library.

Should I write my own implementation of ProgressDialog from scratch? What is the reason it's not included in AppCompat library?

like image 754
Dima Kornilov Avatar asked Jun 09 '15 10:06

Dima Kornilov


People also ask

Is ProgressDialog deprecated?

ProgressDialog 's look can be replicated by placing a ProgressBar into an AlertDialog . You can still use it, but Android does not want you to use it, that is why it is deprecated.

What is ProgressDialog?

Android ProgressDialog is a dialog box/dialog window which shows the progress of a task. Android Progress Dialog is almost same as ProgressBar with the exception that this is displayed as a dialog box. In order to create a ProgressDialog to display a ProgressBar we need to instantiate it like this.

How do I instantiate an object for ProgressDialog class?

In order to do this, you need to instantiate an object of this class. Its syntax is. ProgressDialog progress = new ProgressDialog(this); Now you can set some properties of this dialog.


2 Answers

Widget.AppCompat.* styles can be used starting from API 7.

There is currently no AppCompat style for the progress dialog since it relies on AnimatedVectorDrawable.

However, it's possible to write a custom drawable that has the same behavior and apply it to your ProgressDialog.

check out GIT

like image 127
Ahmad Sanie Avatar answered Oct 11 '22 14:10

Ahmad Sanie


You can use other cool compatibility libraries besides AppCompat. There are cool libraries which brings fully animated Material Design components to pre-Lolipop Android on Github. The images are from Rey5137's "Material" library. You better use one of such libraries rather that writing from scratch.

material loading icon enter image description here

like image 25
makata Avatar answered Oct 11 '22 13:10

makata