Toast for everyone, you want jelly you got it, you want peanut butter, you got it.
Add to your settings.gradle file
dependencyResolutionManagement {
repositories {
...
maven { url "https://jitpack.io" }
}
}Add to your build.gradle module
dependencies {
...
implementation 'com.github.joaogarrido98:tostada:1.2.2'
}This is a step by step of how to use it.
Time can be either
Tostas.FASTor
Tostas.SLOWDisplay an information Toast:
Tostas.info(this, "This is an information", Tostas.SLOW)Display an error Toast:
Tostas.error(this, "This is an error", Tostas.SLOW)Display an success Toast:
Tostas.success(this, "This is a success", Tostas.SLOW)Display an warn Toast:
Tostas.warn(this, "This is a warning", Tostas.SLOW)Display a neutral Toast:
Tostas.neutral(this, "This is a neutral", Tostas.SLOW)Display a custom Toast:
val d = AppCompatResources.getDrawable(this, R.drawable.pink_stuff)
Tostas.custom(this, "Custom Toast", Tostas.SLOW, d!!, "#FF69B4")Display an information Toast:
Tostas.info(Activity.this, "This is an information", Tostas.FAST);Display an error Toast:
Tostas.error(Activity.this, "This is an error", Tostas.FAST);Display an success Toast:
Tostas.success(Activity.this, "This is a success", Tostas.FAST);Display an warn Toast:
Tostas.warn(Activity.this, "This is a warning", Tostas.FAST);Display a neutral Toast:
Tostas.neutral(Activity.this, "This is a neutral", Tostas.FAST);Display a custom Toast:
Drawable d = AppCompatResources.getDrawable(getActivity(), R.drawable.pink_stuff)
Tostas.custom(Activity.this, "Custom Toast", Tostas.FAST, d, "#FF69B4");