Description
Android Library to show a Custom Toast message.
CustomToast alternatives and similar packages
Based on the "Toast Widget" category.
Alternatively, view customToast alternatives based on common mentions on social networks and blogs.
-
SuperToasts
A library that extends the Android toast framework. -
Android-AppMsg
In-layout notifications. Based on Toast notifications and article by Cyril Mottier (http://android.cyrilmottier.com/?p=773). -
loadtoast
Pretty material design toasts with feedback animations -
MessageBar
An Android Toast replacement, similar to the one seen in the GMail app. -
FloatingToast-Android
Android library to create customizable floating animated toasts like in Clash Royale app -
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 event with image. -
FabToast
Attractive, stylish and customizable toast library for Android.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of CustomToast or a related project?
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