π¦ CustomToastMessage
A beautifully customizable Snackbar library for Android built with Kotlin. Easily show snack messages with icons, actions, borders, colors, and much more β all with a single builder call.
π Dependency
Add this to your module build.gradle:
implementation 'com.github.vaishaliichandel:CustomToastMessage:1.0.0'Ensure JitPack is included in your project-level settings.gradle.kts:
dependencyResolutionManagement {
repositories {
maven { url = uri("https://jitpack.io") }
}
}β‘οΈ How to Use
Snacking.Builder(view, "Your message here")
.build()
.show()π Features & Examples
β Basic Snackbar
Snacking.Builder(rootView, "Hello! this is basic message")
.build()
.show()β¨ Elevation
.elevation(5F)π Icon with Tint
.icon(R.drawable.ic_info, R.color.teal_200) or .icon(R.drawable.ic_info,"#00594A") π§² Action Button with custom color
.action("Dismiss", R.color.teal_200, object : Snacking.Callback {
override fun onActionClick(snackBar: Snacking?) {
snackBar?.dismiss()
}
})β Close Icon
.actionClose(R.drawable.ic_close, R.color.teal_200, object : Snacking.Callback {
override fun onActionClick(snackBar: Snacking?) {
snackBar?.dismiss()
}
})π― Corner Radius
.cornerRadius(30F)π§© Custom Corner Radius
.cornerRadius(15f, 0f, 0f, 15f)π Border with Color
.border(2F, R.color.colorPrimary)
.cornerRadius(10F)π¨ Background Color
.backgroundColor(R.color.purple_200)π Text Color
.textColor(R.color.teal_200)π Font Style & Family
.fontFamily(R.font.montserrat)
.textStyle(Snacking.BOLD_ITALIC)π§ Top Position
.position(Snacking.TOP)π Max Lines
.messageMaxLines(2)β³ INDEFINITE Duration
.duration(Snacking.INDEFINITE)π§Ό Remove Margin
.removeMargin()πΈ Check out Video for examples
https://github.com/user-attachments/assets/09c2d332-cabe-4ee7-b347-43731dc75013π‘ Contribution
Feel free to fork, open issues, or submit pull requests. Show some β€οΈ by giving this repo a β!
π©βπ» Developer
Vaishali Chandel