SuperToast

John Persano edited this page Feb 21, 2014 · 11 revisions

Screenshot

Introduction

Standard SuperToasts are made to replace stock Android Toasts. SuperToasts can be created from a non-Activity Context.

Usage

SuperToasts should be used where an Activity Context is not available.

Purpose

SuperToasts have many customization options that are not available in the stock Android toast class.

Features

  1. Customization options such as background color, font, text size, animation etc.
  2. Duration can be any millisecond value under 4500.
  3. An icon can be displayed along with the SuperToast.

Examples

A simple SuperToast displaying the text "Hello world!"
SuperToast.create(this, "Hello world!", SuperToast.Duration.LONG).show();  

A green styled SuperToast displaying the text "Hello world!" with a different animation
SuperToast.create(this, "Hello world!", SuperToast.Duration.LONG, 
    Style.getStyle(Style.GREEN, SuperToast.Animations.FLYIN)).show();

A SuperToast displaying the text "Hello world!" with an icon.
SuperToast superToast = new SuperToast(this);
superToast.setDuration(SuperToast.Duration.LONG);
superToast.setText("Hello world!");
superToast.setIcon(SuperToast.Icon.Dark.INFO, SuperToast.IconPosition.LEFT);
superToast.show(); 
You can’t perform that action at this time.
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.
Press h to open a hovercard with more details.