CuteToast

A material design Toast Library for Android

Purpose

CuteToast is an Android Custom Toast library that could be used instead of Default Toast. It does everything as Toast but with some extra spice.

CuteToast allows developers to use Toast with Colorful design and Icons. It's open-source and free to use.
Give it a try.!

What's New

  • CuteToast without pre-built icon version added. Check the dependencies.

More changes in Release Tab.

Screenshots

Click to View High Quality

117723451-35f82400-b204-11eb-8914-d5ce84ccbbee

Prerequisites

Add this in your root build.gradle file (not your module build.gradle file):

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

Dependencies

Add this to your module's build.gradle file (make sure the version matches the JitPack badge above):

dependencies {
	...
	implementation 'com.github.ahmmedrejowan.CuteToast:CuteToast:1.2'
}
Gradle

If you want to use only Custom Background Options (no Pre-build Icons), then:

dependencies {
	...
	implementation 'com.github.ahmmedrejowan.CuteToast:CuteToast-Custom:1.2'

}
Gradle

Usage

Each of the following method returns a Toast. Don't Forget to Call .show()

To display an Info Toast:

       CuteToast.ct(this, "This is a Info Toast", CuteToast.LENGTH_SHORT, CuteToast.INFO, true).show();
Java

To display a Warning Toast:

       CuteToast.ct(this, "This is a Warning Toast", CuteToast.LENGTH_SHORT, CuteToast.WARN, true).show();
Java

To display an Error Toast:

       CuteToast.ct(this, "This is a Error Toast", CuteToast.LENGTH_SHORT, CuteToast.ERROR, true).show();
Java

To display a Success Toast:

       CuteToast.ct(this, "This is a Success Toast", CuteToast.LENGTH_SHORT, CuteToast.SUCCESS, true).show();
Java

To display a Happy Toast:

       CuteToast.ct(this, "This is a Happy Toast", CuteToast.LENGTH_SHORT, CuteToast.HAPPY, true).show();
Java

To display a Sad Toast:

       CuteToast.ct(this, "This is a Sad Toast", CuteToast.LENGTH_SHORT, CuteToast.SAD, true).show();
Java

To display a Confuse Toast:

       CuteToast.ct(this, "This is a Confuse Toast", CuteToast.LENGTH_SHORT, CuteToast.CONFUSE, true).show();
Java

To display a Delete Toast:

       CuteToast.ct(this, "This is a Delete Toast", CuteToast.LENGTH_SHORT, CuteToast.DELETE, true).show();
Java

To display a Save Toast:

       CuteToast.ct(this, "This is a Save Toast", CuteToast.LENGTH_SHORT, CuteToast.SAVE, true).show();
Java

To display a Normal Toast:

       CuteToast.ct(this, "This is a Normal Toast", CuteToast.LENGTH_SHORT, CuteToast.NORMAL, true).show();
Java

If you don't want the Icons:

Replace true to false at the end of the statment.

       CuteToast.ct(this, "This is a Info Toast", CuteToast.LENGTH_SHORT, CuteToast.INFO, false).show();
Java
       CuteToast.ct(this, "This is a Error Toast", CuteToast.LENGTH_SHORT, CuteToast.ERROR, false).show();
Java

and same for the other types too.

Or Just Remove the last boolean part

       CuteToast.ct(this, "This is a Info Toast", CuteToast.LENGTH_SHORT, CuteToast.INFO).show();
Java
       CuteToast.ct(this, "This is a Error Toast", CuteToast.LENGTH_SHORT, CuteToast.ERROR).show();
Java

If you want to use Custom Icons:

        CuteToast.ct(this, "This is an Info Toast with Custom Star Icon", CuteToast.LENGTH_SHORT, CuteToast.INFO, R.drawable.ic_star).show();
Java
        CuteToast.ct(this, "This is an Error Toast with Custom Danger Icon", CuteToast.LENGTH_SHORT, CuteToast.ERROR, R.drawable.danger_ic).show();
Java

GitHub

https://github.com/ahmmedrejowan/CuteToast