Created
February 7, 2019 07:10
-
-
Save monsterbrain/72f7c5a640abfba21943cecd0dabd885 to your computer and use it in GitHub Desktop.
Simple Code snippet to quickly add a loading dialog for android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in gradle - use compile in old one | |
implementation 'com.afollestad.material-dialogs:core:0.9.6.0' | |
// Field variable | |
MaterialDialog progressDialog; | |
progressDialog = new MaterialDialog.Builder(context) | |
.title("Loading something") | |
.content("") | |
.progress(true, 0) // true for indeterminate | |
.show(); | |
// to dismiss it | |
if (progressDialog != null) { | |
progressDialog.dismiss(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment