Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

NotificationsYou must be signed in to change notification settings

usman18/TastyToasty

Repository files navigation

API
An easy-to-use library to create tasty 😋 Toasts with a bunch of flavours 🌈 It also provides effortless methods to create Instagram like Toasts 💓

Article

Installation

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'}

Usage

Instagram Toasts

  1. Instagram Like

TastyToasty.instaLike(MainActivity.this,"1").show();


Similarly2. instaFollower and3. instaComment can be used



  1. Instagram All

TastyToasty.instaAll(MainActivity.this,"101","20","60").show();


VIBGYOR Toasts 🌈

  1. 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 🤗


Standard Toasts

  1. Success

TastyToasty.success(MainActivity.this,"Task Successful").show();

Similarly the rest ofstandard (error, trending, star) can be used



Custom Toasts

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();

Note:

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

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.

Lets become friends

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 💓

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp