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.dev-aniketj:roasted-toast:1.0.2'
}
To display an normal Toast:
Toasty.normal(context, "Normal Toast");
To display an success Toast:
Toasty.success(context, "Success Toast");
To display an error Toast:
Toasty.error(context, "Error Toast");
To display an warning Toast:
Toasty.warning(context, "Warning Toast");
To display the custom Toast:
Toasty.custom(Context context, String message, int drawable, String backgroundColor, int textSize, String textColor)
Toasty.custom(context, "Custom Toast", R.drawable.icon, "#ff3300", 16, "#f9f9f9");
Toasty.custom(Context context, String message, int gravity, int duration, int drawable, String backgroundColor, int textSize, String textColor)
Toasty.custom(context, "Custom Toast", Gravity.BOTTOM, Toast.LENGTH_SHORT, R.drawable.icon, "#ff3300", 16, "#f9f9f9");
Please fork this repository and contribute back. Any contributions, large or small, major or minor features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed.