MyCustomToast

Additional

Language
Kotlin
Version
N/A
Created
Jan 6, 2019
Updated
Jan 7, 2019 (Retired)
Owner
MEET PRAJAPATI (meet30997)
Contributor
MEET PRAJAPATI (meet30997)
1
Activity
Badge
Generate
Download
Source code

Advertisement

MyCustomToast-Android-Custom-Toast-With-Icon-and-color

A simple way to customize your toast with different colors and icon!

Installation

  1. You have to copy a class in your project which I created called Mytoast

  2. 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.

  1. It takes string value of color for toast background.

  2. It takes string value of color for toast textcolor.

  3. 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?

  1. Fork the project.
  2. Make required changes and commit.
  3. Generate pull request. Mention all the required description regarding changes you made. Happy coding.:-)