CoolToast

Additional

Language
Java
Version
N/A
Created
Aug 26, 2017
Updated
Jun 16, 2020 (Retired)
Owner
Nadim GOUIA (nadimgouia)
Contributor
Nadim GOUIA (nadimgouia)
1
Activity
Badge
Generate
Download
Source code

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);