Skip to content

Instantly share code, notes, and snippets.

@monsterbrain
Created February 7, 2019 07:10
Show Gist options
  • Save monsterbrain/72f7c5a640abfba21943cecd0dabd885 to your computer and use it in GitHub Desktop.
Save monsterbrain/72f7c5a640abfba21943cecd0dabd885 to your computer and use it in GitHub Desktop.
Simple Code snippet to quickly add a loading dialog for android
// 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