We all use Android Toast in our application and definitely bored with native Android Toast. You can see many way to create custom Toast for your Android application. But today i am showing you a great Android Library which helps an user to get rid of their native Android Toast.
TastyToast helps the user by characterising the type of Toast into five main category which are success, danger, warning, info and default.
- For each default category, it not only changes
background
andtext colour
but also adds tasty Custom View on the left side of Toast.
The library provides flexibility to customize text color, background of Toast and has specific toast icon for each category.
Recommended article:
- Android 7.0 Nougat Update
- OpenLauncher – Make Launcher in Android
- Top 5 IoT Hacks
- Top 10 Weird design Mobile Phone
- How to Create India Map Using C/Java Program
How to create custom Android Toast using TastyToast
It very easy to use lets show first demo then we dive with code:
Preview
Dependency
Add dependency in your app module
dependencies { compile 'com.sdsmdg.tastytoast:tastytoast:0.1.1' }
Usage
Java
TastyToast.makeText(getApplicationContext(), "Hello World !", TastyToast.LENGTH_LONG, TastyToast.WARNING);
Last parameter here is the type of toast you want to show.
Thats it how easy it is. Isn’t it ? Please tell us in comment with your thoughts.
Share your thoughts