Skip to content

๐Ÿ“ฑ Android Library to implement, beautiful, stylish ๐Ÿ˜ Toast in Android apps easily.

Notifications You must be signed in to change notification settings

KulkarniAtharva/TastyToast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

27 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ˜‹TastyToast ๐Ÿž for Android ๐Ÿ“ฑ

๐Ÿ“ฑ Android Library to implement Rich, Beautiful Toasts for your project with all Guidelines. Easy to use.

Introduction

TastyToast library is built to implement fancy toasts in any Android app. This API will be useful to create rich, animated, beautiful Toasts in Android app easily.

Requirements

  • AndroidX
  • Minimum SDK API 19

Implementation

Implementation of TastyToast ๐Ÿ˜‹ library is so easy. You can check /app directory for demo. Let's have look on basic steps of implementation. In this demo, we will populate the menu contents by a menu resource file.

Prerequisite

Gradle

In build.gradle of app module, include these dependencies.

dependencies 
{
    // TastyToast library
    implementation 'dev.atharvakulkarni:TastyToast:1.1'
}

Usage

All the programmatic way of implementation of TastyToast library is here.

General syntax of TastyToast : TastyToast.success(context,"text",duration,shape,android icon);


duration :  TastyToast.LENGTH_SHORT
            TastyToast.LENGTH_LONG
            
shape :  TastyToast.SHAPE_ROUND     
         TastyToast.SHAPE_RECTANGLE 
         
android icon : true
               false
Toast type Code Preview
Normal TastyToast.normal(this,"This is a Normal Toast w/o icon",TastyToast.LENGTH_LONG);

TastyToast.normal(this,"This is a Normal Toast with icon",R.drawable.android, TastyToast.LENGTH_LONG);
normal toast
Simple TastyToast.simple(this,"This is Simple Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_ROUND, false);

TastyToast.simple(this,"This is Simple Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_RECTANGLE, false);

TastyToast.simple(this,"This is Simple Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_ROUND, true);

TastyToast.simple(this,"This is Simple Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_RECTANGLE, true);
Success TastyToast.success(this,"This is a Success Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_ROUND, false);

TastyToast.success(this,"This is a Success Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_RECTANGLE, false);

TastyToast.success(this,"This is a Success Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_ROUND, true);

TastyToast.success(this,"This is a Success Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_RECTANGLE, true);
Info TastyToast.info(this,"Here is some Info for you",TastyToast.LENGTH_LONG, TastyToast.SHAPE_ROUND, false);

TastyToast.info(this,"Here is some Info for you",TastyToast.LENGTH_LONG, TastyToast.SHAPE_RECTANGLE, false);

TastyToast.info(this,"Here is some Info for you",TastyToast.LENGTH_LONG, TastyToast.SHAPE_ROUND, true);

TastyToast.info(this,"Here is some Info for you",TastyToast.LENGTH_LONG, TastyToast.SHAPE_RECTANGLE, true);
Warning TastyToast.warning(this,"Beware of dog",TastyToast.LENGTH_LONG, TastyToast.SHAPE_ROUND, false);

TastyToast.warning(this,"Beware of dog",TastyToast.LENGTH_LONG, TastyToast.SHAPE_RECTANGLE, false);

TastyToast.warning(this,"Beware of dog",TastyToast.LENGTH_LONG, TastyToast.SHAPE_ROUND, true);

TastyToast.warning(this,"Beware of dog",TastyToast.LENGTH_LONG, TastyToast.SHAPE_RECTANGLE, true);
Confusing TastyToast.confusing(this,"This is Confusing Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_ROUND, false);

TastyToast.confusing(this,"This is Confusing Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_RECTANGLE, false);

TastyToast.confusing(this,"This is Confusing Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_ROUND, true);

TastyToast.confusing(this,"This is Confusing Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_RECTANGLE, true);
Error TastyToast.error(this,"This is an Error Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_ROUND,false);

TastyToast.error(this,"This is an Error Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_RECTANGLE, false);

TastyToast.error(this,"This is an Error Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_ROUND, true);

TastyToast.error(this,"This is an Error Toast",TastyToast.LENGTH_LONG, TastyToast.SHAPE_RECTANGLE, true);

Position of toast can also be set by using the function POSITION as follows :

TastyToast.success(this,"This is a Success Toast",TastyToast.LENGTH_LONG,TastyToast.SHAPE_ROUND,false) .setPosition(POSITION.TOP);

Different Positions
                    - TOP
                    - BOTTOM
                    - CENTER
                    - LEFT
                    - RIGHT
                    - TOP_LEFT
                    - TOP_RIGHT
                    - BOTTOM_LEFT
                    - BOTTOM_RIGHT

Contributing

Please fork this repository and contribute back using pull requests.
If you like this library, please do share with someone who need it.

Any contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed .

Contact - Lets become friend

Don't forget to star โญ the repo it motivates me to share more open source

Donation

If this project help you reduce time to develop, you can give me a cup of coffee :) or dinner ๐Ÿ• ๐Ÿ” will also do ๐Ÿ˜œ

License

Project is published under the Apache-2.0 license. Feel free to clone and modify repo as you want, but don't forget to add reference to authors :)


Copyright 2020 Atharva Kulkarni

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
`

About

๐Ÿ“ฑ Android Library to implement, beautiful, stylish ๐Ÿ˜ Toast in Android apps easily.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages