Add this in your root build.gradle
file (not your module build.gradle
file):
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
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'
}
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();
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();
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 .
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.