MyCustomToast-Android-Custom-Toast-With-Icon-and-color
A simple way to customize your toast with different colors and icon!
Installation
-
You have to copy a class in your project which I created called Mytoast
-
And You have to copy a custom layout for toast, Which I created called toast_layout.xml
Usage
There is a only one standard method to display customized toast, This method returns a customized toast!
Mytoast().make(
this,
"Please Check Your Internet Connection!",
Toast.LENGTH_SHORT,
"#f44336", // Toast BackgroundColor
#ffffff, // Toast TextColor
R.drawable.ic_warning_black_24dp // Drawable Int
).show()
As You can see this method takes 3 extra values to make a toast.
-
It takes string value of color for toast background.
-
It takes string value of color for toast textcolor.
-
It takes drawable Int to display icon in Toast.
Just Type null
if you don't want to modify above values
Please call show()
method to display the toast.
How to contribute?
- Fork the project.
- Make required changes and commit.
- Generate pull request. Mention all the required description regarding changes you made. Happy coding.:-)