Skip to content

lazy-pr0grammer/MotionToast-Easiotic

Repository files navigation

MotionToast-Easiotic

Java version of MotionToast 🔥

This is the first Java version of MotionToast by Lazy-pr0grammer.

Don't forget to check Spikeysanju's library also: Spikeysanju's MotionToast

platform GitHub license GitHub stars GitHub forks Repo size GitHub follow

A beautiful Toast library in Android Java ♨️

GitHub Cards Preview

Types of toast style 😋

  • Light MotionToasts: Light MotionToasts

  • Dark MotionToasts: Dark MotionToasts

What's New 👻

  1. Added round corner support for Light full color toasts.
  2. Made it more easy for everyone.
  3. Removed old fonts and added new fonts.
  4. Now the library is more easy-to-use.

How to use? 🤔

Step 1: Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

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

Add dependency in your app module

dependencies {
  implementation 'com.github.lazy-pr0grammer:MotionToast-Easiotic:1.2' 
}

Five types of Toast 🖐🏻

1. MotionStyle.SUCCESS

2. MotionStyle.WARNING

3. MotionStyle.ERROR

4. MotionStyle.INFO

5. MotionStyle.DELETE

Toast duration ⏳

1. MotionStyle.LENGTH_SHORT //3 seconds

2. MotionStyle.LENGTH_LONG //4 seconds

Toast modes 🐸

1. MotionStyle.LIGHT

2. MotionStyle.DARK

Toast gravity 🚀

1. MotionStyle.TOP

2. MotionStyle.CENTER

3. MotionStyle.BOTTOM

Color mode 🌈

1. 0 //Zero is for full color Toast

2. 1 //One is for transparent color Toast

Sample codes for MotionToasts ❄

Full color Success MotionToast(Light)

MotionToast motionToast = new MotionToast(
        MainActivity.this,
        0,
        MotionStyle.LIGHT,
        MotionStyle.SUCCESS,
        MotionStyle.BOTTOM,
        "SUCCESS",
        "You got succeed :)",
        MotionStyle.LENGTH_SHORT
);

motionToast.show();

Transparent color Success MotionToast(Dark)

MotionToast motionToast = new MotionToast(
        MainActivity.this,
        1,
        MotionStyle.LIGHT,
        MotionStyle.SUCCESS,
        MotionStyle.BOTTOM,
        "SUCCESS",
        "You got succeed :)",
        MotionStyle.LENGTH_SHORT
);

motionToast.show();

Full color Success MotionToast(Dark)

MotionToast motionToast = new MotionToast(
        MainActivity.this,
        0,
        MotionStyle.DARK,
        MotionStyle.SUCCESS,
        MotionStyle.BOTTOM,
        "SUCCESS",
        "You got succeed :)",
        MotionStyle.LENGTH_SHORT
);

motionToast.show();

Transparent color Success MotionToast(Dark)

MotionToast motionToast = new MotionToast(
        MainActivity.this,
        1,
        MotionStyle.DARK,
        MotionStyle.SUCCESS,
        MotionStyle.BOTTOM,
        "SUCCESS",
        "You got succeed :)",
        MotionStyle.LENGTH_SHORT
);

motionToast.show();



Thank you for exploring MotionToast-Easiotic!
Happy coding! 🚀