Skip to content

benwong0/frenchtoast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

The goal of FrenchToast is to create a more flexible and stylish Toast system for Android. It should maintain the basic functions of the Android Toast system while allowing more flexible customizations.

FrenchToast also allows multiple toast on screen. Toast will stack on top of each other.

Quick Start

// This example assumes it'll be used in an Activity. (this == Activity).

// Pixel density
float scale = getResources().getDisplayMetrics().density;

// Create a new toast with the text "Hello World". Toast will be dismissed in 15 seconds.
FrenchToast toast = FrenchToast.make(this, "Hello World", 15);

// Set padding around toast content, in this case, the text "Hello World".
toast.setPadding(Math.round(scale * 10), Math.round(scale * 5), Math.round(scale * 10), Math.round(scale * 5));

// Set a custom background. This could be color or image.
toast.setBackgroundResource(R.drawable.my_toast_background);

// Set a toast text color.
toast.setTextColor(ContextCompat.getColor(this, R.color.my_toast_text_color));

// Set toast text size.
toast.setTextSize(15);

// Show toast!
toast.show();

Hide Toast

toast.hide();

Clear All Toasts

FrenchToast.clear();

About

A more flexible and stylish toast for Android.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages