Tostcu makes Toasts to feed your app.
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.hamurcuabi:Tostcu:1.0.0'
}
This step is optional, but if you want you can configure some Tostcu parameters. Place this anywhere in your app:
Toasty.Config.getInstance()
.setErrorColor(@ColorInt int errorColor) // optional
.setInfoColor(@ColorInt int infoColor) // optional
.setSuccessColor(@ColorInt int successColor) // optional
.setWarningColor(@ColorInt int warningColor) // optional
.setToastTypeface(@NonNull Typeface typeface) // optional
.setTextSize(int sizeInSp) // optional
.setWithAnim(boolean with_anim)//optional
.apply(); // required
You can reset the configuration by using reset()
method:
Toasty.Config.reset();
This following basic methodes have default variables. You can change them we have some easy methodes.
```LENGTH_SHORT,
```with_anim=true,
```text_size=16 sp,
```typeface=(sans-serif-condensed", Typeface.NORMAL),
```Gravity.Center
To display basic error Toast:
Tostcu.error(yourContext, "This is an error toast.");
To display basic success Toast:
Tostcu.success(yourContext, "This is an success toast.");
To display basic info Toast:
Tostcu.info(yourContext, "This is an info toast.");
To display basic warning Toast:
Tostcu.warning(yourContext, "This is an warning toast.");
You can also create your custom Toasts with the custom()
method:
Tostcu.custom(yourContext, "I'm a custom Toast", yourDrwableResid,duration, bg_color, gravity, with_anim,typeface,text_size);
Tostcu.warning(yourContext, "This is an warning toast.");
or
Tostcu.warning(yourContext, R.string.warning_message);
This blink animation can be set false but it is true default.
Muziczak Free Mp3 [![](https://jitpack.io/v/hamurcuabi/Tostcu.svg)](https://jitpack.io/#hamurcuabi/Tostcu)