public final class FoxBaseToastUtils
extends java.lang.Object
author: Blankj
blog : http://blankj.com
time : 2016/09/29
desc : utils about toast
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
cancel()
Cancel the toast.
|
static void |
setBgColor(int backgroundColor)
Set the color of background.
|
static void |
setBgResource(int bgResource)
Set the resource of background.
|
static void |
setGravity(int gravity,
int xOffset,
int yOffset)
Set the gravity.
|
static void |
setMsgColor(int msgColor)
Set the color of message.
|
static void |
setMsgTextSize(int textSize)
Set the text size of message.
|
static android.view.View |
showCustomLong(int layoutId)
Show custom toast for a long period of time.
|
static android.view.View |
showCustomLong(android.view.View view)
Show custom toast for a long period of time.
|
static android.view.View |
showCustomShort(int layoutId)
Show custom toast for a short period of time.
|
static android.view.View |
showCustomShort(android.view.View view)
Show custom toast for a short period of time.
|
static void |
showLong(java.lang.CharSequence text)
Show the toast for a long period of time.
|
static void |
showLong(int resId)
Show the toast for a long period of time.
|
static void |
showLong(int resId,
java.lang.Object... args)
Show the toast for a long period of time.
|
static void |
showLong(java.lang.String format,
java.lang.Object... args)
Show the toast for a long period of time.
|
static void |
showShort(java.lang.CharSequence text)
Show the toast for a short period of time.
|
static void |
showShort(int resId)
Show the toast for a short period of time.
|
static void |
showShort(int resId,
java.lang.Object... args)
Show the toast for a short period of time.
|
static void |
showShort(java.lang.String format,
java.lang.Object... args)
Show the toast for a short period of time.
|
public static void setGravity(int gravity,
int xOffset,
int yOffset)
gravity - The gravity.xOffset - X-axis offset, in pixel.yOffset - Y-axis offset, in pixel.public static void setBgColor(int backgroundColor)
backgroundColor - The color of background.public static void setBgResource(int bgResource)
bgResource - The resource of background.public static void setMsgColor(int msgColor)
msgColor - The color of message.public static void setMsgTextSize(int textSize)
textSize - The text size of message.public static void showShort(java.lang.CharSequence text)
text - The text.public static void showShort(int resId)
resId - The resource id for text.public static void showShort(int resId,
java.lang.Object... args)
resId - The resource id for text.args - The args.public static void showShort(java.lang.String format,
java.lang.Object... args)
format - The format.args - The args.public static void showLong(java.lang.CharSequence text)
text - The text.public static void showLong(int resId)
resId - The resource id for text.public static void showLong(int resId,
java.lang.Object... args)
resId - The resource id for text.args - The args.public static void showLong(java.lang.String format,
java.lang.Object... args)
format - The format.args - The args.public static android.view.View showCustomShort(int layoutId)
layoutId - ID for an XML layout resource to load.public static android.view.View showCustomShort(android.view.View view)
view - The view of toast.public static android.view.View showCustomLong(int layoutId)
layoutId - ID for an XML layout resource to load.public static android.view.View showCustomLong(android.view.View view)
view - The view of toast.public static void cancel()