Toastie is a customizable Android toast library.

Related tags

Toast Toastie
Overview

Toastie

Android Arsenal API

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: Please check above for the latest version!

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

Step 2. Add the dependency

dependencies {
    implementation 'com.github.MrNtlu:Toastie:latest.version'
}

Maven

Step 1. Add the JitPack repository to your build file

<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>

Step 2. Add the dependency

<dependency>
  <groupId>com.github.MrNtlu</groupId>
  <artifactId>Toastie</artifactId>
  <version>latest.version</version>
</dependency>

Usage

Warning Toast:

Toastie.warning(MainActivity.this,"Warning Toast", Toast.LENGTH_LONG).show();
Toastie.centerWarning(MainActivity.this,"Warning Toast", Toast.LENGTH_LONG).show();
Toastie.topWarning(MainActivity.this,"Warning Toast", Toast.LENGTH_LONG).show();

Success Toast:

Toastie.success(MainActivity.this,"Success Toast",Toast.LENGTH_LONG).show();
Toastie.centerSuccess(MainActivity.this,"Success Toast",Toast.LENGTH_LONG).show();
Toastie.topSuccess(MainActivity.this,"Success Toast",Toast.LENGTH_LONG).show();

Info Toast:

Toastie.info(MainActivity.this,"Info Toast.",Toast.LENGTH_LONG).show();
Toastie.centerInfo(MainActivity.this,"Info Toast.",Toast.LENGTH_LONG).show();
Toastie.topInfo(MainActivity.this,"Info Toast.",Toast.LENGTH_LONG).show();

Error Toast:

Toastie.error(MainActivity.this,"Error Toast.",Toast.LENGTH_LONG).show();
Toastie.centerError(MainActivity.this,"Error Toast.",Toast.LENGTH_LONG).show();
Toastie.topError(MainActivity.this,"Error Toast.",Toast.LENGTH_LONG).show();

Custom Toast:

Toastie.custom(MainActivity.this,"Custom Toast.",R.drawable.icon,R.color.background,Toast.LENGTH_LONG).show();
Toastie.centerCustom(MainActivity.this,"Custom Toast.",R.drawable.icon,R.color.background,Toast.LENGTH_LONG).show();
Toastie.topCustom(MainActivity.this,"Custom Toast.",R.drawable.icon,R.color.background,Toast.LENGTH_LONG).show();

Fully customizable toast, you can set the attributes that you need.

Toastie.allCustom(MainActivity.this)
                        .setTypeFace(Typeface.DEFAULT_BOLD)
                        .setTextSize(16)
                        .setCardRadius(25)
                        .setCardElevation(10)
                        .setIcon(R.drawable.ic_error_black_24dp)
                        .setCardBackgroundColor(R.color.colorAccent)
                        .setMessage("Fully customizable toast. But in a different way.")
                        .setGravity(Gravity.CENTER,5,5)
                        .createToast(Toast.LENGTH_LONG)
                        .show();

Same as previous one but different way calling it.

Toastie.allCustom(MainActivity.this,"Fully custom toast. Ugly as ... :)",R.drawable.ic_info_black_36dp,
                        R.color.infoColor,cornerRadius,elevation,textSize,Typeface.SANS_SERIF,Gravity.TOP, xOffset,yOffset,Toast.LENGTH_LONG).show();

Screenshots

You might also like...
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-

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

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

Simple toast

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

 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

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

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

Balloon  🎈 A lightweight popup like tooltips, fully customizable with arrow and animations.
Balloon 🎈 A lightweight popup like tooltips, fully customizable with arrow and animations.

Balloon 🎈 A lightweight popup like tooltips, fully customizable with arrow and animations.

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

Comments
  • Request: support Android 11 (R - API 31)

    Request: support Android 11 (R - API 31)

    Sadly on Android R, you can't set a custom View for a Toast (when targeting API 31) :

    https://developer.android.com/reference/android/widget/Toast#setView(android.view.View) https://developer.android.com/reference/android/widget/Toast#getView()

    Please offer something that mimics the standard Toast's look&feel, so that at least we could have it shown within the app, as a normal View. Maybe something similar to what we have when we long press the action items on the toolbar:

    dfu6CwFaPM.zip

    Custom Toasts are useful anyway usually only when the user is inside the app...

    opened by AndroidDeveloperLB 1
Releases(1.1.0)
Owner
Burak Fidan
Mobile Developer & Computer Eng. Student - Istanbul
Burak Fidan
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

Dean Spencer 11 Feb 14, 2022
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

null 9 Nov 15, 2021
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

null 2 Jun 12, 2022
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

John Persano 2.7k Dec 29, 2022
🍞 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

David Voiss 229 Nov 25, 2022
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

null 21 Dec 20, 2022
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

Kylix Eza S 6 Sep 15, 2022
MDToast - MaterialDesign Toast library written with Kotlin with lots of extensions to interact easily in contexts

MDToast - MaterialDesign Toast A lightweight Toast library written with Kotlin i

Morteza Omar Mohammady 12 Dec 23, 2022
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

Evgeny Shishkin 1.4k Nov 25, 2022
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

Simon Vig Therkildsen 555 Nov 25, 2022