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 {
implementation 'com.github.vedraj360:AnimatedToast:0.1.0'
}
* ANIMATION_PULSE
* ANIMATION_ROTATE
* ANIMATION_BLINK
* ANIMATION_FLIP
To display an default Toast:
AnimatedToast.defaultToast("yourContext","Default Toast",Gravity.CENTER,Toast.LENGTH_SHORT,AnimatedToast.ANIMATION_ROTATE);
To display a success Toast:
AnimatedToast.Success(getApplicationContext(), "Success", Gravity.TOP, Toast.LENGTH_SHORT, AnimatedToast.ANIMATION_ROTATE);
To display the error Toast:
AnimatedToast.Error(getApplicationContext(), "Error", Gravity.CENTER, Toast.LENGTH_SHORT, AnimatedToast.ANIMATION_BLINK);
To display a warning Toast:
AnimatedToast.Warning(getApplicationContext(), "Warning", Gravity.CENTER, Toast.LENGTH_SHORT, AnimatedToast.ANIMATION_PULSE);
To display an info Toast:
AnimatedToast.Info(getApplicationContext(), "Info", Gravity.BOTTOM, Toast.LENGTH_SHORT, AnimatedToast.ANIMATION_FLIP);
Just write DesignerToast.STYLE_DARK in parameter
To display a success Toast:
AnimatedToast.Success("yourContext", "Success","Hello this is demo success!",Gravity.CENTER, Toast.LENGTH_SHORT,AnimatedToast.STYLE_DARK, AnimatedToast.ANIMATION_ROTATE);
To display the error Toast:
AnimatedToast.Error("yourContext", "Error","Hello this is demo error!",Gravity.CENTER, Toast.LENGTH_SHORT,AnimatedToast.STYLE_DARK,AnimatedToast.ANIMATION_BLINK);
To display a warning Toast:
AnimatedToast.Warning("yourContext", "Warning", "Hello this is demo warning!",Gravity.CENTER, Toast.LENGTH_SHORT,AnimatedToast.STYLE_DARK, AnimatedToast.ANIMATION_FLIP);
To display an info Toast:
AnimatedToast.Info("yourContext", "Info","Hello this is demo info!",Gravity.CENTER, Toast.LENGTH_SHORT,AnimatedToast.STYLE_DARK,AnimatedToast.ANIMATION_PULSE);
Please fork this repository and contribute back. Any contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed .
Copyright 2020 Vedraj360
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.