Popularity
0.4
Stable
Activity
0.0
Stable
3
1
0

Description

Android Library to show a Custom Toast message.

Programming language: Java
License: Creative Commons Zero v1.0 Universal
Tags: UI     Android     Toast Widget     Java     Custom View     Android-library     Toast    

CustomToast alternatives and similar packages

Based on the "Toast Widget" category.
Alternatively, view customToast alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of CustomToast or a related project?

Add another 'Toast Widget' Package

README

CustomToast

Android Library to show Custom Toast message

Support:

[Please don't use v1.2 or 1.2 they are deleted and not meant for production , they are actually not usable]

To get a Git project into your build:

Step 1. Add the JitPack repository to your build file

gradle

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

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

Step 2. Add the dependency

dependencies {
        implementation 'com.github.sad-adnan:customToast:v1.3'
}

Use Case

From version 1.1 you have default value of toast as Toast>LENGTH_SHORT so you can just give one parameter (2nd one) less, if you need short length.

CustomToast.ShowSuccessToast(MainActivity.this,"Congratulations"); // 2nd parameter DEFAULT value false --> Toast.LENGTH_SHORT

you can show a success message by using below code :

    CustomToast.ShowSuccessToast(MainActivity.this,false,"Congratulations"); // 2nd parameter true --> Toast.LENGTH_LONG  , false --> Toast.LENGTH_SHORT

you can show a Error message by using below code :

    CustomToast.ShowErrorToast(MainActivity.this,false,"We are extremely sorry."); // 2nd parameter true --> Toast.LENGTH_LONG  , false --> Toast.LENGTH_SHORT

you can show a Info message by using below code :

    CustomToast.ShowInfoToast(MainActivity.this,false,"We have updated your status."); // 2nd parameter true --> Toast.LENGTH_LONG  , false --> Toast.LENGTH_SHORT

you can show a custom Toast message with icon and message by using below code : you have to pass drawable resource id (R.drawable.yourdrawable) and color id (R.color.yourcolor) in 4th and 5th Parameter respectively

    CustomToast.showToastWithCustomDrawableAndBG(MainActivity.this,false,"Custom Icon",R.drawable.ic_baseline_auto_delete_24,R.color.toastColor); // 2nd parameter true --> Toast.LENGTH_LONG  , false --> Toast.LENGTH_SHORT
    CustomToast.showToastWithoutIcon(MainActivity.this,false,"Without icon",R.color.toastColor2); // this method will only show text, without any drawable , 2nd parameter true --> Toast.LENGTH_LONG  , false --> Toast.LENGTH_SHORT