Toast with gradients.
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:
dependencies {
...
implementation 'com.github.Poriazy:GradyToast-Android:1.0'
}
enlarge photo by click on it.
Create Object of GradyToast:
GradyToast gradyToast = new GradyToast(yourContext);
// or
GradyToast gradyToast = new GradyToast();
gradyToast.with(yourContext);
// or use the other constructors
You Can change GradyToast appearance with these types:
public enum GradyType {
PRIMARY,
SUCCESS,
ERROR,
WARNING,
INFO,
LIGHT,
DARK,
CUSTOM,
}
Sample:
gradyToast
.with(yourContext)
.setText("HelloWorld!")
.setType(GradyType.SUCCESS);
You can also create your custom Toasts with the .setType(GradyType.CUSTOM)
,method:
GradyToast myCustomGrady = new GradyToast();
myCustomGrady
.with(yourContext)
.setText("Your Toast Message")
.setDuration(GradyDuration.LONG)
.setTextSize(24)
.setType(GradyType.CUSTOM)
.setTextColor("#bdc3c7")
.setCustomColors("#FF0099", "#493240", "#000000" )
.setGradyStrokeSize(3)
.show();
GradyToast simpleGrady = new GradyToast(yourContext);
simpleGrady.setText("Hello World!");
/*
* Defaults:
* tostDuration -> GradyDuration.SHORT
* tostSyle -> GradyType.PRIMARY
*
*/