Skip to content
Pretty material design toasts with feedback animations
Branch: master
Clone or download
Wannes Ghielens
Wannes Ghielens version bump in readme
Latest commit 5d2ed47 Oct 4, 2017

Load Toast Library

The default toasts are ugly and don't really provide much more than a short message. This small library provides a better toast which will give the user feedback by morphing into a checkmark or cross (success and fail). The lifetime of the toast is completely controlled by you.



Step 1


dependencies {
    compile 'net.steamcrafted:load-toast:1.0.12'

Step 2

The API is very simple, create a new toast by providing a context:

LoadToast lt = new LoadToast(context);

Change the displayed text:

lt.setText("Sending Reply...");

If you don't have a message to display, the toast will shrink to only show the circular loader.

Then proceed to show the toast:;

When your background thingy is done provide feedback to the user and hide the toast:

// Call this if it was successful

// Or this method if it failed

// Or if no feedback is desired you can simply hide the toast

To properly position the toast use the following method to adjust the Y offset:

lt.setTranslationY(100); // y offset in pixels

You can also change the colors of the different toast elements:


In some situations a border might be desired for increased visibility, by default it is transparent:

// Change the border color
lt.setBorderColor(int color);

// Change the border width
lt.setBorderWidthPx(int widthPx);
lt.setBorderWidthDp(int widthDp);
lt.setBorderWidthRes(int resourceId);

When displaying a message in a RTL language you can force the text to marquee from left to right instead of the default right to left:

// pass in false for RTL text, true for LTR text
lt.setTextDirection(boolean isLeftToRight);

These can be chained as you can see.


Released under the Apache 2.0 License

You can’t perform that action at this time.