Skip to content

Commit bbdf902

Browse files
committed
see 03/04 log
1 parent 53f9aba commit bbdf902

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

utilcode/src/main/java/com/blankj/utilcode/util/ToastUtils.java

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* author: Blankj
2626
* blog : http://blankj.com
2727
* time : 2016/09/29
28-
* desc : 吐司相关工具类
28+
* desc : utils about toast
2929
* </pre>
3030
*/
3131
public final class ToastUtils {
@@ -46,11 +46,11 @@ private ToastUtils() {
4646
}
4747

4848
/**
49-
* 设置吐司位置
49+
* Set the gravity.
5050
*
51-
* @param gravity 位置
52-
* @param xOffset x 偏移
53-
* @param yOffset y 偏移
51+
* @param gravity The gravity.
52+
* @param xOffset X-axis offset, in pixel.
53+
* @param yOffset Y-axis offset, in pixel.
5454
*/
5555
public static void setGravity(final int gravity, final int xOffset, final int yOffset) {
5656
sGravity = gravity;
@@ -59,55 +59,55 @@ public static void setGravity(final int gravity, final int xOffset, final int yO
5959
}
6060

6161
/**
62-
* 设置背景颜色
62+
* Set the color of background.
6363
*
64-
* @param backgroundColor 背景色
64+
* @param backgroundColor The color of background.
6565
*/
6666
public static void setBgColor(@ColorInt final int backgroundColor) {
6767
sBgColor = backgroundColor;
6868
}
6969

7070
/**
71-
* 设置背景资源
71+
* Set the resource of background.
7272
*
73-
* @param bgResource 背景资源
73+
* @param bgResource The resource of background.
7474
*/
7575
public static void setBgResource(@DrawableRes final int bgResource) {
7676
sBgResource = bgResource;
7777
}
7878

7979
/**
80-
* 设置消息颜色
80+
* Set the color of message.
8181
*
82-
* @param msgColor 颜色
82+
* @param msgColor The color of message.
8383
*/
8484
public static void setMsgColor(@ColorInt final int msgColor) {
8585
sMsgColor = msgColor;
8686
}
8787

8888
/**
89-
* 安全地显示短时吐司
89+
* Show the toast for a short period of time.
9090
*
91-
* @param text 文本
91+
* @param text The text.
9292
*/
9393
public static void showShort(@NonNull final CharSequence text) {
9494
show(text, Toast.LENGTH_SHORT);
9595
}
9696

9797
/**
98-
* 安全地显示短时吐司
98+
* Show the toast for a short period of time.
9999
*
100-
* @param resId 资源 Id
100+
* @param resId The resource id for text.
101101
*/
102102
public static void showShort(@StringRes final int resId) {
103103
show(resId, Toast.LENGTH_SHORT);
104104
}
105105

106106
/**
107-
* 安全地显示短时吐司
107+
* Show the toast for a short period of time.
108108
*
109-
* @param resId 资源 Id
110-
* @param args 参数
109+
* @param resId The resource id for text.
110+
* @param args The args.
111111
*/
112112
public static void showShort(@StringRes final int resId, final Object... args) {
113113
if (args != null && args.length == 0) {
@@ -118,10 +118,10 @@ public static void showShort(@StringRes final int resId, final Object... args) {
118118
}
119119

120120
/**
121-
* 安全地显示短时吐司
121+
* Show the toast for a short period of time.
122122
*
123-
* @param format 格式
124-
* @param args 参数
123+
* @param format The format.
124+
* @param args The args.
125125
*/
126126
public static void showShort(final String format, final Object... args) {
127127
if (args != null && args.length == 0) {
@@ -132,28 +132,28 @@ public static void showShort(final String format, final Object... args) {
132132
}
133133

134134
/**
135-
* 安全地显示长时吐司
135+
* Show the toast for a long period of time.
136136
*
137-
* @param text 文本
137+
* @param text The text.
138138
*/
139139
public static void showLong(@NonNull final CharSequence text) {
140140
show(text, Toast.LENGTH_LONG);
141141
}
142142

143143
/**
144-
* 安全地显示长时吐司
144+
* Show the toast for a long period of time.
145145
*
146-
* @param resId 资源 Id
146+
* @param resId The resource id for text.
147147
*/
148148
public static void showLong(@StringRes final int resId) {
149149
show(resId, Toast.LENGTH_LONG);
150150
}
151151

152152
/**
153-
* 安全地显示长时吐司
153+
* Show the toast for a long period of time.
154154
*
155-
* @param resId 资源 Id
156-
* @param args 参数
155+
* @param resId The resource id for text.
156+
* @param args The args.
157157
*/
158158
public static void showLong(@StringRes final int resId, final Object... args) {
159159
if (args != null && args.length == 0) {
@@ -164,10 +164,10 @@ public static void showLong(@StringRes final int resId, final Object... args) {
164164
}
165165

166166
/**
167-
* 安全地显示长时吐司
167+
* Show the toast for a long period of time.
168168
*
169-
* @param format 格式
170-
* @param args 参数
169+
* @param format The format.
170+
* @param args The args.
171171
*/
172172
public static void showLong(final String format, final Object... args) {
173173
if (args != null && args.length == 0) {
@@ -178,7 +178,7 @@ public static void showLong(final String format, final Object... args) {
178178
}
179179

180180
/**
181-
* 安全地显示短时自定义吐司
181+
* Show custom toast for a short period of time.
182182
*/
183183
public static View showCustomShort(@LayoutRes final int layoutId) {
184184
final View view = getView(layoutId);
@@ -187,7 +187,7 @@ public static View showCustomShort(@LayoutRes final int layoutId) {
187187
}
188188

189189
/**
190-
* 安全地显示长时自定义吐司
190+
* Show custom toast for a long period of time.
191191
*/
192192
public static View showCustomLong(@LayoutRes final int layoutId) {
193193
final View view = getView(layoutId);
@@ -196,7 +196,7 @@ public static View showCustomLong(@LayoutRes final int layoutId) {
196196
}
197197

198198
/**
199-
* 取消吐司显示
199+
* Cancel the toast.
200200
*/
201201
public static void cancel() {
202202
if (sToast != null) {

0 commit comments

Comments
 (0)