[8.2.8][i18n] 所有吐司 中文抽取
This commit is contained in:
@@ -113,7 +113,8 @@ fun View.onClick(block: (View) -> Unit) {
|
||||
fun View.onClick(during:Int,block: (View) -> Unit) {
|
||||
this.setOnClickListener {
|
||||
if (ClickUtils.isClickTooFrequent(this,during)) {
|
||||
ToastUtils.showShort("不要频繁点击哦~")
|
||||
// ToastUtils.showShort("不要频繁点击哦~")
|
||||
ToastUtils.showShort(R.string.module_mogo_core_function_hmi_dot_often_click1)
|
||||
return@setOnClickListener
|
||||
}
|
||||
block(it)
|
||||
|
||||
@@ -513,20 +513,24 @@ public final class ToastUtils {
|
||||
@Nullable final CharSequence text,
|
||||
final int duration,
|
||||
@NonNull final ToastUtils utils) {
|
||||
UtilsBridge.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
cancel();
|
||||
IToast iToast = newToast(utils);
|
||||
ToastUtils.sWeakToast = new WeakReference<>(iToast);
|
||||
if (view != null) {
|
||||
iToast.setToastView(view);
|
||||
} else {
|
||||
iToast.setToastView(text);
|
||||
try {
|
||||
UtilsBridge.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
cancel();
|
||||
IToast iToast = newToast(utils);
|
||||
ToastUtils.sWeakToast = new WeakReference<>(iToast);
|
||||
if (view != null) {
|
||||
iToast.setToastView(view);
|
||||
} else {
|
||||
iToast.setToastView(text);
|
||||
}
|
||||
iToast.show(duration);
|
||||
}
|
||||
iToast.show(duration);
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static CharSequence getToastFriendlyText(CharSequence src) {
|
||||
|
||||
4
core/mogo-core-utils/src/main/res/values/string.xml
Normal file
4
core/mogo-core-utils/src/main/res/values/string.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="module_mogo_core_function_hmi_dot_often_click1">不要频繁点击哦~</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user