This repository has been archived by the owner on Jun 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 499
SuperToast
John Persano edited this page Feb 21, 2014
·
11 revisions
Standard SuperToasts are made to replace stock Android Toasts. SuperToasts can be created from a non-Activity Context.
SuperToasts should be used where an Activity Context is not available.
SuperToasts have many customization options that are not available in the stock Android toast class.
- Customization options such as background color, font, text size, animation etc.
- Duration can be any millisecond value under 4500.
- An icon can be displayed along with the SuperToast.
SuperToast.create(this, "Hello world!", SuperToast.Duration.LONG).show();
SuperToast.create(this, "Hello world!", SuperToast.Duration.LONG,
Style.getStyle(Style.GREEN, SuperToast.Animations.FLYIN)).show();
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();