public class Toast
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
backColor
Back color used in the toast.
|
static int |
buttonHGap
Gap between the text and the button, horizontally
|
static int |
buttonVGap
Gap between the text and the button, vertically.
|
static Container |
cnt
The toast component used to show the text.
|
static int |
extraW
Extra width of the toast in font's height multiples.
|
static int |
fade
The stopping fade value, used on transparency.
|
static Font |
font
The font to be used.
|
static int |
foreColor
Fore color used in the toast.
|
static int |
height
Height of the toast.
|
static int |
INFINITE |
static int |
INFINITE_NOANIM |
static int |
paddingBottom
Padding of the component.
|
static int |
paddingLeft
Padding of the component.
|
static int |
paddingRight
Padding of the component.
|
static int |
paddingTop
Padding of the component.
|
static int |
posX
X position of the toast.
|
static int |
posY
Y position of the toast.
|
static int |
width
Width of the toast.
|
Constructor and Description |
---|
Toast() |
Modifier and Type | Method and Description |
---|---|
static void |
show(java.lang.String message,
int delay)
Shows a toast message using the given parameters on the main window.
|
static void |
show(java.lang.String message,
int delay,
java.lang.String buttonCaption,
int buttonForeColor,
PressListener btnPressListener)
Shows a toast message with a button using the given parameters on the main window.
|
static void |
show(java.lang.String message,
int delay,
Window parentWindow)
Shows a toast message using the given parameters on the given window.
|
static void |
show(java.lang.String message,
int delay,
Window parentWindow,
java.lang.String buttonCaption,
int buttonForeColor,
PressListener btnPressListener)
Shows a toast message with a button using the given parameters on the given window.
|
static void |
stopShow()
Unpop the Toast from the screen.
|
static void |
stopShow(boolean animate)
Unpop the Toast from the screen.
|
public static int backColor
public static int foreColor
public static int posX
public static int posY
public static int extraW
public static int width
public static int height
public static int fade
public static Font font
public static int paddingLeft
public static int paddingRight
public static int paddingTop
public static int paddingBottom
public static int buttonHGap
public static int buttonVGap
public static Container cnt
public static final int INFINITE
public static final int INFINITE_NOANIM
public static void show(java.lang.String message, int delay)
show(String, int, Window)
public static void show(java.lang.String message, int delay, Window parentWindow, java.lang.String buttonCaption, int buttonForeColor, PressListener btnPressListener)
public static void show(java.lang.String message, int delay, java.lang.String buttonCaption, int buttonForeColor, PressListener btnPressListener)
#show(String, int, Window, String, PressListener)
public static void show(java.lang.String message, int delay, Window parentWindow)
String message = "This is a test"; Toast.show("\n"+message+"\n", 2000);See the public static fields of this class to show how you can customize the appearance. Calling with a nulled message will make the last toast disappear. The text is splitted if wider than the screen. If delay is INFINITE, it will wait forever until you call stopShow(). If delay is INFINITE_NOANIM, it will wait forever until you call stopShow() and will not use animation.
public static void stopShow()
public static void stopShow(boolean animate)
animate
- Animate the Toast with fading out.