Skip to content

Using this Library you can replace your Old Toast to New Toast. This is currently in beta version. more features will added soon.

Notifications You must be signed in to change notification settings

nitishk72/New-Toast

Repository files navigation

New Toast Library

API License

Prerequisites

Add this in your root build.gradle file (not your module build.gradle file):

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}

Dependency

Add this to your module's build.gradle file (make sure the version matches the JitPack badge above):

dependencies {
	...
	compile 'com.github.nitishk72:New-Toast:0.1.0'
}

Setup

Now you have to call NewToast wherever you want to call. To call NewToast Just do this.

NewToast.makeToast(MainActivity.this,
                        "THIS IS TOAST MESSAGE ",
                        NewToast.LENGTH_SHORT,
                ).show();

NewToast comes with 5 different flavour

For DEFAULT

NewToast.makeToast(MainActivity.this,
                        "THIS IS TOAST MESSAGE ",
                        NewToast.LENGTH_SHORT,
                        NewToast.DEFAULT
                ).show();

For Success

NewToast.makeToast(MainActivity.this,
                        "THIS IS TOAST MESSAGE ",
                        NewToast.LENGTH_SHORT,
                        NewToast.SUCCESS
                ).show();

For INFO

NewToast.makeToast(MainActivity.this,
                        "THIS IS TOAST MESSAGE ",
                        NewToast.LENGTH_SHORT,
                        NewToast.INFO
                ).show();

For Success

NewToast.makeToast(MainActivity.this,
                        "THIS IS TOAST MESSAGE ",
                        NewToast.LENGTH_SHORT,
                        NewToast.SUCCESS
                ).show();

For WARNING

NewToast.makeToast(MainActivity.this,
                        "THIS IS TOAST MESSAGE ",
                        NewToast.LENGTH_SHORT,
                        NewToast.WARNING
                ).show();

For DANGER

NewToast.makeToast(MainActivity.this,
                        "THIS IS TOAST MESSAGE ",
                        NewToast.LENGTH_SHORT,
                        NewToast.DANGER
                ).show();

Contributing

Please fork this repository and contribute back using pull requests.

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

License

Copyright 2017 Nitish Kumar Singh

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

Using this Library you can replace your Old Toast to New Toast. This is currently in beta version. more features will added soon.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages