All Projects → developingdeveloper-tech → toaster-android

developingdeveloper-tech / toaster-android

Licence: MIT license
A simple library to add custom toast to android applications.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to toaster-android

TastyToasty
An easy-to-use library to create tasty 😋 Toasts with a bunch of flavours 🌈. It also provides effortless methods to create Instagram like Toasts 💓
Stars: ✭ 54 (+145.45%)
Mutual labels:  toast, ui-widget
Toasty
The usual Toast, but with steroids 💪
Stars: ✭ 6,279 (+28440.91%)
Mutual labels:  toast, ui-widget
Notyf
👻 A minimalistic, responsive, vanilla JavaScript library to show toast notifications.
Stars: ✭ 2,093 (+9413.64%)
Mutual labels:  toast, custom-toast
React Native Smart Tip
🔥🔥🔥Toast , SnackBar , Modal , Show Toast above Modal
Stars: ✭ 198 (+800%)
Mutual labels:  toast
Vue Toast Notification
Yet another toast notification plugin for Vue.js 🌷
Stars: ✭ 205 (+831.82%)
Mutual labels:  toast
Squawk
Quick & interactive iOS alerts in Swift.
Stars: ✭ 254 (+1054.55%)
Mutual labels:  toast
React-Toast
Custom push notification (Toast) implementation under React + stayed by TailwindCSS.
Stars: ✭ 74 (+236.36%)
Mutual labels:  toast
Tfpopup
🚀🚀🚀TFPopup不生产弹框,它只是弹框的弹出工🚀🚀🚀默认支持多种动画方式一行调用,支持完全自定义动画.
Stars: ✭ 182 (+727.27%)
Mutual labels:  toast
react-native-rooster
Your toast solution for react-native apps 🐔
Stars: ✭ 19 (-13.64%)
Mutual labels:  toast
Toasted Notes
simple, flexible toast notifications for react
Stars: ✭ 241 (+995.45%)
Mutual labels:  toast
Jh flutter demo
a flutter demo
Stars: ✭ 229 (+940.91%)
Mutual labels:  toast
Snackbar
A tiny browser library for showing a brief message at the bottom of the screen (1kB gzipped).
Stars: ✭ 224 (+918.18%)
Mutual labels:  toast
Toast
🍞 The rounded and animated Android Toast for .NET WPF/XAML
Stars: ✭ 25 (+13.64%)
Mutual labels:  toast
Wc Messagebox
基于 Vue 2.0 开发的 Alert, Toast, Confirm 插件, UI仿照 iOS 原生
Stars: ✭ 203 (+822.73%)
Mutual labels:  toast
toaststrap
A simple, lightweight JavaScript library for showing Bootstrap 5 toast popups.
Stars: ✭ 16 (-27.27%)
Mutual labels:  toast
Sweetalert2
A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies.
Stars: ✭ 13,929 (+63213.64%)
Mutual labels:  toast
simple-notify
Pure javascript toast notifications.
Stars: ✭ 108 (+390.91%)
Mutual labels:  toast
Overlay support
a flutter toast and notification library
Stars: ✭ 232 (+954.55%)
Mutual labels:  toast
Toast Swift
Toast view using swift.
Stars: ✭ 228 (+936.36%)
Mutual labels:  toast
Teaset
A UI library for react native, provides 20+ pure JS(ES6) components, focusing on content display and action control.
Stars: ✭ 2,845 (+12831.82%)
Mutual labels:  toast

Toaster-Android

GitHub release (latest by date including pre-releases) GitHub GitHub (Pre-)Release Date Language

Toaster-Android is a simple open source library to customize toast messages in android applications. It has some predefined templates for common use-cases like warning, error and success messages.

Buy Me A Coffee

Download

Step 1

Add the JitPack repository to your build.gradle(project).

allprojects {
  repositories {
  	...
  	maven { url 'https://jitpack.io' }
  }
}

Step 2

Add the dependency to your build.gradle(Module: app).

dependencies {
  implementation 'com.github.5AbhishekSaxena.toaster-android:toaster:2.3.1'
  implementation 'com.github.5AbhishekSaxena.toaster-android:toaster-ktx:2.3.1' //for ktx support
}

Please Note: toaster-ktx includes toaster module so, if you are using toaster-ktx version then you don't have to add taoster

How to use Toaster-Android

Video:

A simple use case will look like this

Toaster.pop(
             this,
             "A simple toast message"
         ).show()

With a custom drawable

Toaster.pop(
              this,
              "A simple toast message with image",
              R.drawable.ic_baseline_cloud_done_24 /* image */
          ).show()

Code Snippets

Using templates
  • Success
	Toaster.popSuccess(
                  this,
                  "This is a success message",
                  Toaster.LENGTH_SHORT
              ).show()

  • Warning
	Toaster.popWarning(
              this,
              "This is a warning message",
              Toaster.LENGTH_SHORT
          ).show()

  • Error
	Toaster.popError(
              this,
              "This is an error message",
              Toaster.LENGTH_SHORT
          ).show()

Custom Toast
  1. Create a toast config
      val toastConfig = Toaster.Config(
              message = "File uploaded successfully",
              leftDrawableRes = R.drawable.ic_baseline_cloud_done_24,
              leftDrawableTint = R.color.blue,
              stripTint = R.color.blue,
              duration = Toaster.LENGTH_SHORT,
          )
  1. Add the config to the Toaster.pop
    Toaster.pop(toastConfig.make(context)).show()

Custom Toast (toaster-ktx)

With the toaster-ktx, you can either make Taoster or directly create Toast with the provided functions.

  1. Create Taoster and then poping it.
  • Create Taoster usign ktx
val toaster = prepareToaster(this) {
             message = "File uploaded successfully"
             leftDrawableRes = R.drawable.ic_baseline_cloud_done_24
             leftDrawableTint = R.color.blue
             stripTint = R.color.blue
             duration = Toaster.LENGTH_SHORT
         }
Toaster.pop(toaster).show()
  • Pop the Toast
Toaster.pop(toaster).show()
  1. Directly make Toast and show it
prepareToast(this) {
             message = "File uploaded successfully"
             leftDrawableRes = R.drawable.ic_baseline_cloud_done_24
             leftDrawableTint = R.color.blue
             stripTint = R.color.blue
             duration = Toaster.LENGTH_SHORT
 }.show()

Contributing

  • For contributions in this repository, please read Contribution guidelines for this project first. (Please pull the changes from this repo if you have already forked the repository and are facing conflicts)
  • If you like the repository, please star it.

License

MIT License. See the LICENSE file for details

Author

Abhishek Saxena

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].