Toasts that never get cut off.
A drop-in toast for Android. Five styles, messages that wrap instead of truncating, eight variable fonts you can tune per call. One line of Kotlin.
implementation("com.github.muhammedelsami:Toastoy:1.4.0")
Try it
Pick a type to show a toast. Paste a long message to see it wrap.
Five types, one surface.
A dark, rounded card that reads on light and dark themes alike. The icon carries the meaning; the message carries the words.
Call it from anywhere.
Pass an Activity, a Fragment's context, or any other Context. Style a single toast with the optional arguments, or set defaults once.
-
Wraps, never clipsUp to four lines. Grows to the screen width before it wraps; capped on tablets.
-
Variable fontsEight bundled families with Latin, Turkish and Arabic coverage. Any weight from 100 to 900.
-
No resource collisionsEverything is prefixed with
toastoy_, so your app's colours, layouts and fonts stay untouched. -
Android 7.0 and upminSdk 24. Variable weights need API 26; older devices get the font's default instance.
// one line
Toastoy.showSuccessToast(this, "Your profile has been updated")
// every type has the same shape
Toastoy.showErrorToast(this, "Payment failed. Please try again")
Toastoy.showWarningToast(this, "Low storage: 512 MB remaining")
Toastoy.showInfoToast(this, "New version available")
Toastoy.showDefaultToast(this, "Settings saved")
// style one toast
Toastoy.showInfoToast(
this, "Bold & bigger",
ToastoyFont.ALEXANDRIA, 20f, ToastoyFontWeight.BOLD
)
// or set defaults once, e.g. in Application.onCreate()
Toastoy.defaultFont = ToastoyFont.RUBIK
Toastoy.defaultTextSize = 15f
Toastoy.defaultFontWeight = ToastoyFontWeight.SEMI_BOLD
Eight fonts, three scripts.
Free variable fonts from Google Fonts, bundled with the library. Each one covers English, Turkish and Arabic, so one toast style works across your whole app.
Add it in a minute.
Available on JitPack. MIT licensed. Sample app in the repository.