Skip to content
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.
Branch: master
Clone or download
1
Latest commit a1900d9 Aug 27, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea Initial commit Aug 26, 2017
CoolToast
app
gradle/wrapper Initial commit Aug 26, 2017
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle Initial commit Aug 26, 2017

README.md

CoolToast

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 even with image.

Gradle

compile on your dependencies


dependencies {
    compile 'com.ndroid.nadim:cool-toast:1.0'
}

ScreenShot

Sample Example

Sample Module

Usage

To create a new cool toast


  CoolToast coolToast = new CoolToast(this);
  coolToast.make("Your first cool toast ! ");

To set the style of your cool toast


  //you have many style that you can use for your toast ( SUCCESS, DANGER, WARNING, INFO, PRIMARY, DARK, LIGHT)
  coolToast.make("That is a red cool toast ! ", CoolToast.DANGER);
  //or you can set the style with setStyle() method
  coolToast.setStyle(CoolToast.DANGER);
  coolToast.make("That is a red cool toast ! ");

To set duration, position or make a rounded Toast


   //display the toast at the center of screen (you can use : CoolToast.LEFT, CoolToast.RIGHT, CoolToast.CENTER)
   coolToast.setPosition(CoolToast.CENTER);
   //make the corners round
   coolToast.setRounded(true); 
   //set the duration (it can be CoolToast.SHORT or CoolToast.LONG...)
   //By default it is : CoolToast.LONG
   coolToast.setDuration(CoolToast.SHORT); 
   coolToast.make("Info with image", CoolToast.INFO);

Display a Cool Toast With Custom icon


  coolToast.setIcon(R.drawable.like);
  coolToast.make("Info with image", CoolToast.INFO, CoolToast.LONG);

You can’t perform that action at this time.