Add this in your root build.gradle
file (not your module build.gradle
file):
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Add this to your module's build.gradle
file (make sure the version matches the JitPack badge above):
dependencies {
...
implementation 'com.github.ChanphengHor:PToasting:1.0.0'
}
For this Configuration you can use to your Base/Super Class or onCreate to a activity
PToast.edit()
.setDuration(PToast.LENGTH_SHORT)
.setGravity(Gravity.BOTTOM,0,50) / .setGravity(Gravity.BOTTOM)
.hasMargin(true)
.setTransparent(false)
.done(); // finally
PToast just simply use static class :
Displaying a simple PToast:
PToast.show(this,"This is simple PToast !!");
Displaying a danger PToast:
PToast.danger(this,"This is Danger PToast !!");
Displaying a warning PToast:
PToast.warning(this,"This is Warning PToast !!");
Displaying a info PToast:
PToast.info(this,"This is Info PToast !!");
Displaying a success PToast:
PToast.success(this,"This is Success PToast !!");
Displaying a strong PToast:
PToast.success(this,"Strong : ","=> this is Strong PToast !!");
Displaying a html PToast:
PToast.successAsHTML(this,"<strong>Strong</strong> <u>Underline</u> => html Tag Toast");