ZProgressHUD is a progress dialog with HUD style for Android.
To use the HUD, clone this project and import it into your workspace. Then reference it from your main project as a library.
ZProgressHUD is based on singleton pattern, you must initialize it before using:
ZProgressHUD progressHUD = ZProgressHUD.getInstance(context);
Please notice that you must pass a context to the getInstance() method.
You can set your custom message (instead of "Loading ..." by default) by calling setMessage()
method. Be aware of the length of the message, it will be cut if too long.
At the moment, there are 3 types of spinner: GEAR_SPINNER, SIMPLE_ROUND_SPINNER and FADED_ROUND_SPINNER. You can set it by calling setSpinnerType()
.
Just call show()
as a normal dialog.
You can dismiss the HUD in 2 ways: success and failure. For each of those, you can set your custom message for the HUD.
progressHUD.dismissWithSuccess("Done"); progressHUD.dismissWithFailure("Spoil");
Default message is set to "Success" and "Failure" for success and failure respectively.
=================== Please feel free to drop me an email at thuongnh.uit@gmail.com to improve the HUD.