MDToast - MaterialDesign Toast library written with Kotlin with lots of extensions to interact easily in contexts

Last update: Apr 22, 2022

MDToast - MaterialDesign Toast

A lightweight Toast library written with Kotlin inspired by MDToast with Easy to use extensions for Kotlin developers and fully accessable for Java Developers. If you don't know how to use extension methods, first search about it :)

  • Info

    Info Toast

  • Success

    Success Toast

  • Warning

    Warning Toast

  • Error

    Error Toast

  • Download Demo Link

Extentions

All these extensions available for Context class, and you can use it everywhere that context or activity instance is available ( or applicationContext ). see examples

Extensions Usage
Context.sToast(message) Create an Android default short Toast
Context.lToast(message) Create an Android default long Toast
Context.sInfoToast(message) to show a short Info MDToast
Context.lInfoToast(message) to show a long Info MDToast
Context.sWarningToast(message) to show a short Warning MDToast
Context.lWarningToast(message) to show a long Warning MDToast
Context.sSuccessToast(message) to show a short Success MDToast
Context.lSuccessToast(message) to show a long Success MDToast
Context.sErrorToast(message) to show a short Error MDToast
Context.lErrorToast(message) to show a long Error MDToast

You can also create a fully customized MDToast with Context.customMDToast(...)

Context.customMDToast(
    message: String,
    duration: Int = MDToast.LENGTH_SHORT,
    type: Int = MDToast.TYPE_INFO,
    bgColor: Int? = null,
    icon: Drawable? = null,
    borderRadius: Int? = null,
    elevation: Int? = null,
    typeface: Typeface? = null,
)

Installation

Add jitpack maven link in your root build.gradle ( or settings.gradle base on your gradle version ) at the end of repositories:

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

Add the dependency

dependencies {
     ...
     implementation 'com.github.mortezaom:MDToast:1.0.0'
}

Now you can use MDToast and extensions in your project.

For Java Language Developers

However the extensions are not usable in java language, still you can use MDToast.makeText(...) method in your codes. ( don't forgot to call show() method )

MDToast.makeText(this, message, MDToast.LENGTH_SHORT, MDToast.TYPE_INFO).show()

Types: MDToast.TYPE_INFO, MDToast.TYPE_WARNING, MDToast.TYPE_SUCCESS, MDToast.TYPE_ERROR

Durations: MDToast.LENGTH_SHORT, MDToast.LENGTH_LONG

You can also create a fully customized Toast:

MDToast.makeText(
     Context context,
     String message,
     int duration = LENGTH_SHORT,      
     int type = TYPE_INFO,
     int bgColor = null,
     Drawable tIcon = null,
     int borderRadius = null,
     int elevation = null,
     Typeface typeface = null
).show()

You can enter your custom values instead of each parameters or send null to them, also you can use setters method to change the values for each items.

Contributing

If you can add new things, You are welcome ! you can have pull requests :) Or if there is any question or error you can open a new issue. I will happy to see more stars if you like this :)

Contributors

MortezaOM - [email protected]

The End :)

GitHub

https://github.com/mortezaom/MDToast
You might also like...

An Android Toast replacement, similar to the one seen in the GMail app.

MessageBar An Android Toast replacement, similar to the one seen in the GMail app. Multiple messages can be posted in succession, and each message wil

Jun 15, 2022

Android Custom Toast

Android Custom Toast

Super Toast Library Written Purely in Kotlin ❤ī¸ Usual Toast but with super powers!!! đŸ’Ē A Fully Customised and Customisable Toast. ]( https://android-

May 2, 2021

Android Toast For RTL Applications

Android Toast For RTL Applications

RTL-Toast Android library to show Toasts in a pretty RTL way Install Add it in your root build.gradle allprojects { repositories { ... ma

Oct 19, 2021

Simple toast

newlibrary Simple toast Step 1. Add the JitPack repository to your build file allprojects { repositories { ... maven { url 'https://jitpack.io

Nov 5, 2021

An easy, flexible way to have the toast message displayed.

 An easy, flexible way to have the toast message displayed.

IToaster Library An easy, flexible way to have the toast message displayed. Download Gradle Add below codes to your root build.gradle file (not your m

Mar 19, 2022

This custom snack bar will help you display much more personalized app toast

This custom snack bar will help you display much more personalized app toast

đŸ’Ĩ Presentation Using the native android class of snack bar. This custom snack bar will help you display much more personalized app

May 31, 2022

A tooltip/showcase library for Android re-written in Kotlin.

UglyTooltip Based on another Showcase library. Being kotlinized, customized and refactored.

Apr 27, 2022

Android library to create customizable floating animated toasts like in Clash Royale app

FloatingToast-Android An android library to make customisable floating animated toasts Getting Started In your build.gradle dependencies { impleme

May 31, 2022

An android library for easy implementation of Toasts in Android with easy customisation.

An android library for easy implementation of Toasts in Android with easy customisation.

ToastTypeDecore Šī¸ A library for easy implementation of Toasts in Android with easy customisation. Latest Version : v2.1 Screenshots Success Toast1 Su

Oct 27, 2021
Related tags
A library that extends the Android toast framework.
A library that extends the Android toast framework.

SuperToasts Library The SuperToasts library enhances and builds upon the Android Toast class. This library includes support for context sensitive Supe

Jun 21, 2022
🍞 The missing toast library for Android.
🍞 The missing toast library for Android.

Literally Toast ?? A toast library for Android. Usage: ?? Use the LitToast to get lit and show your users a proper toast. LitToast.create(context, "My

Dec 17, 2021
Toastie is a customizable Android toast library.
Toastie is a customizable Android toast library.

Toastie Getting Started Gradle Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories: Note

Apr 3, 2021
A really simple library that help you to display a custom toast with many colors (for : success, warning, danger, info, dark, light, primary...etc ), or with rounded corners, or event with image.

CoolToast A really simple library that help you to display a custom toast with many colors (for : success, warning, danger, info, dark, light, primary

Jun 22, 2020
Attractive, stylish and customizable toast library for Android.

FabToast min SDK 16 (Jelly Bean 4.1) written in Java To download the demo app for this library from Google Playstore so you can see it in action, clic

Feb 14, 2022
Custom Toast Library by Google Developer Student Club University of Brawijaya
Custom Toast Library by Google Developer Student Club University of Brawijaya

GDSCToast Custom Toast Library by Google Developer Student Club University of Brawijaya Prerequisites For old version of gradle (before arctic fox upd

Jun 1, 2022
Customizable toast message library for Android
Customizable toast message library for Android

Android Custom Toast Message (SnToast) Customizable Toast Message Library For Android Add this in your root build.gradle file allprojects { reposito

Nov 15, 2021
Android : IamToast Another Toast library for Android
 Android : IamToast  Another Toast library for Android

Android : IamToast Another Toast library for Android Warning. toast custom view is deprecated since android 11(R) Setup allprojects { repositories

Jun 12, 2022
The usual Toast, but with steroids đŸ’Ē
The usual Toast, but with steroids đŸ’Ē

Toasty The usual Toast, but with steroids. Prerequisites Add this in your root build.gradle file (not your module build.gradle file): allprojects { r

Jun 23, 2022
In-layout notifications. Based on Toast notifications and article by Cyril Mottier (http://android.cyrilmottier.com/?p=773).
In-layout notifications. Based on Toast notifications and article by Cyril Mottier (http://android.cyrilmottier.com/?p=773).

Android AppMsg (Crouton) Library Implementation of in-layout notifications. Based on Toast notifications and article The making of Prixing #4: in-layo

Jun 19, 2022