Skip to content

Latest commit

 

History

History
52 lines (32 loc) · 1.83 KB

TOAST.md

File metadata and controls

52 lines (32 loc) · 1.83 KB

Fusion

Fusion By BlackBeared License: GPL v3

An Easy-to-use Kotlin based Customizable Library with Material Layouts by @blackbeared.

Fully Customizable Toasts with some inbuilt functions.

Fusion

Sample Usage

A pre-styled toasts with fully customization facility.

     AwesomeToast.success(this@Dashboard, "Green Success Toast").show()
     AwesomeToast.info(this@Dashboard, "Cyan Information Toast").show()
     AwesomeToast.warning(this@Dashboard,  "Orange Warning Toast").show()
     AwesomeToast.error(this@Dashboard,  "Red Error Toast").show()

Customization

        AwesomeToast.Config.getInstance()
            .setErrorColor(@ColorInt int errorColor) // optional
            .setInfoColor(@ColorInt int infoColor) // optional
            .setSuccessColor(@ColorInt int successColor) // optional
            .setWarningColor(@ColorInt int warningColor) // optional
            .setTextColor(@ColorInt int textColor) // optional
            .tintIcon(boolean tintIcon) // optional (apply textColor also to the icon)
            .setToastTypeface(@NonNull Typeface typeface) // optional
            .setTextSize(int sizeInSp) // optional
            .apply(); // required

You can reset the configuration by using reset() method:

      AwesomeToast.Config.reset();

Description

Use the above code to show different type of messages as well as add the customization code to your Launcher activity to customise toasts.