- paste this in build.gradle (project)
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- paste this in build.gradle (module)
dependencies {
implementation 'com.github.VVan228:LoadingDialog:0.3'
}
DialogFragment dial = new DialogFragment();
Loading load = new Loading(Color.rgb(255,250,250), Color.TRANSPARENT, Color.RED, 20.0f);
load.show(getSupportFragmentManager(), "dial");
- main background color
- second background color (fragment back)
- foreground color
- border radius
- string (default - Loading)
load.cancel();
You can also set onCancelListener like this:
load.setOnCancelListener(new onCancelListener() {
@Override
public void onCancel() {
Log.d("animation", "cancelled");
}
});