Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

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();