- Notifications
You must be signed in to change notification settings - Fork8
An easy-to-use library to create tasty 😋 Toasts with a bunch of flavours 🌈. It also provides effortless methods to create Instagram like Toasts 💓
License
usman18/TastyToasty
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
An easy-to-use library to create tasty 😋 Toasts with a bunch of flavours 🌈 It also provides effortless methods to create Instagram like Toasts 💓
Add this in your rootbuild.gradle
file (not your modulebuild.gradle
file):
allprojects {repositories {...maven { url"https://jitpack.io" }}}
Add this to your module'sbuild.gradle
file :
dependencies {... implementation'com.github.usman18:TastyToasty:v1.2'}
- Instagram Like
TastyToasty.instaLike(MainActivity.this,"1").show();
Similarly2. instaFollower
and3. instaComment
can be used
- Instagram All
TastyToasty.instaAll(MainActivity.this,"101","20","60").show();
- VIOLET
TastyToasty.violet(MainActivity.this,"Its lit",R.drawable.ic_whatshot).show();
Similarly the rest ofVIBGYOR can be used
You can pass null for those arguments which you don't want in your Toast (eg Toast w/o icon or w/o Text). We've handled it for you 🤗
- Success
TastyToasty.success(MainActivity.this,"Task Successful").show();
Similarly the rest ofstandard (error, trending, star) can be used
1. using makeText()
// Pass the last attribute as false or null if your do not want the tail in ToastTastyToasty.makeText(MainActivity.this,"This is a custom toast",TastyToasty.LONG,R.drawable.ic_action_favourite,R.color.violet,R.color.white,true).show();
2. Builder Method (More easier to use)
newTastyToasty.Builder(MainActivity.this) .setText("This one is using builder method") .setBackgroundColor(R.color.green) .setIconId(R.drawable.ic_verified_user) .showTail(true)// Pass false or null or don't call at all if you don't want the "tail" in your toast .show();
Using builder method you can create customized Toasts pretty easily. Only call the methods for attributes which you would like to have in your Toast.For example, if you want a Toast with just icon, just call that method (make sure you always pass the context though) and ignore the rest of the attribute setting methods. Below is an example of the same.
//Default text color is white and default background color is pinkinsh rednewTastyToasty.Builder(MainActivity.this) .setIconId(R.drawable.ic_whatshot) .show();
Like my work ? You can tip mehere
Contributions are always welcome. Please fork this repository and contribute using pull requests. The pull requests will be thoroughly assessed and if found significant will be accepted.
My email :uk32971@gmail.com
About
An easy-to-use library to create tasty 😋 Toasts with a bunch of flavours 🌈. It also provides effortless methods to create Instagram like Toasts 💓