Customizable toast message library for Android
Android Custom Toast Message (SnToast)
Customizable Toast Message Library For Android.
Add this in your root build.gradle file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add this to your module's build.gradle file
dependencies {
implementation 'com.github.emreesen27:Android-Custom-Toast-Message:1.0.2'
}
Usage
It very simple!
Toast Types
- SUCCESS
- ERROR
- WARNING
- INFORMATION
Standard
new SnToast.Standard()
.context(YourActivity.this)
.type(Type.SUCCESS)
.message("Success !")
// .iconSize(int size) Optional Default: 34dp
// .textSize(int size) Optional Default 18sp
// .animation(false or true) Optional Default: True
// .duration(int ms) Optional Default: 3000ms
.build();
Custom
new SnToast.Custom()
.context(YourActivity.this)
.backgroundColor(R.color.your_bg_color)
.textColor(R.color.your_text_color)
.icon(R.drawable.your_icon)
// .iconSize(int size) Optional Default: 34dp
// .textSize(int size) Optional Default 18sp
// .animation(false or true) Optional Default: True
// .duration(int ms) Optional Default: 3000ms
.message("Custom !!!")
.build();
Showcase
Success Toast | Error Toast |
---|---|
Warning Toast | Information Toast |
---|---|