You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This step is optional, but if you want you can configure some Toasty parameters. Place this anywhere in your app:
Toasty.Config.getInstance()
.tintIcon(booleantintIcon) // optional (apply textColor also to the icon)
.setToastTypeface(@NonNullTypefacetypeface) // optional
.setTextSize(intsizeInSp) // optional
.allowQueue(booleanallowQueue) // optional (prevents several Toastys from queuing)
.setGravity(intgravity, intxOffset, intyOffset) // optional (set toast gravity, offsets are optional)
.supportDarkTheme(booleansupportDarkTheme) // optional (whether to support dark theme or not)
.setRTL(booleanisRTL) // optional (icon is on the right)
.apply(); // required
You can reset the configuration by using reset() method:
Toasty.Config.reset();
Usage
Each method always returns a Toast object, so you can customize the Toast much more. DON'T FORGET THE show() METHOD!
To display an error Toast:
Toasty.error(yourContext, "This is an error toast.", Toast.LENGTH_SHORT, true).show();