Customizable Toast Message Library For Android
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.emreesen27:Android-Custom-Toast-Message:1.0.5'
}
It very simple!
new SnToast.Builder()
.context(MainActivity.this)
.type(Type.SUCCESS)
.message("Success !")
//.cancelable(false or true) Optional Default: False
// .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
// .backgroundColor(R.color.example) Default: It is filled according to the toast type. If an assignment is made, the assigned value is used
// .icon(R.drawable.example) Default: It is filled according to the toast type. If an assignment is made, the assigned value is used
.build();
Typeface type = ResourcesCompat.getFont(getApplicationContext(), R.font.example);
.typeface(type) // Optional Default: sans-serif-condensed
- SUCCESS
- ERROR
- WARNING
- INFORMATION
Success Toast | Error Toast |
---|---|
Warning Toast | Information Toast |
---|---|