Skip to content

πŸ“¦ CustomToastMessage is a fully customizable and elegant Snackbar library for Android, built with Kotlin. Effortlessly display toast/snack messages with icons, actions, borders, background colors, corner radius, fonts, positions, and more β€” all through a simple builder pattern.

Notifications You must be signed in to change notification settings

vaishaliichandel/CustomToastMessage

Repository files navigation

πŸ“¦ 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

GitHub Profile

About

πŸ“¦ CustomToastMessage is a fully customizable and elegant Snackbar library for Android, built with Kotlin. Effortlessly display toast/snack messages with icons, actions, borders, background colors, corner radius, fonts, positions, and more β€” all through a simple builder pattern.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published