[8.2.8][i18n] 所有吐司 中文抽取
This commit is contained in:
@@ -12,6 +12,7 @@ import com.mogo.eagle.core.function.main.MainPresenter
|
||||
import com.mogo.eagle.core.utilcode.mogo.permissions.PermissionsDialogUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.utils.PermissionUtil
|
||||
|
||||
open class BaseBluetoothManager {
|
||||
@@ -48,7 +49,8 @@ open class BaseBluetoothManager {
|
||||
return BluetoothState.OFF
|
||||
}
|
||||
}
|
||||
ToastUtils.showShort("设备无蓝牙硬件")
|
||||
// ToastUtils.showShort("设备无蓝牙硬件")
|
||||
ToastUtils.showShort(R.string.module_och_not_bluetooth)
|
||||
return BluetoothState.NONE
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.bluetooth.BluetoothProfile
|
||||
import android.util.Log
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import io.reactivex.disposables.Disposable
|
||||
@@ -190,7 +191,8 @@ class OchBluetoothGattCallback(device: BluetoothDevice) : BluetoothGattCallback(
|
||||
return null
|
||||
}
|
||||
val service = mBluetoothGatt!!.getService(uuid)
|
||||
if (service == null) ToastUtils.showShort("没有找到服务UUID=$uuid")
|
||||
// if (service == null) ToastUtils.showShort("没有找到服务UUID=$uuid")
|
||||
if (service == null) ToastUtils.showShort(R.string.module_och_bluetooth_not_find_uuid, "$uuid")
|
||||
return service
|
||||
}
|
||||
|
||||
@@ -223,7 +225,8 @@ class OchBluetoothGattCallback(device: BluetoothDevice) : BluetoothGattCallback(
|
||||
fun connectGattAndSend(data: String) {
|
||||
RxUtils.disposeSubscribe(timeoutCLose)
|
||||
if(isConnected){
|
||||
ToastUtils.showShort("已连接成功")
|
||||
// ToastUtils.showShort("已连接成功")
|
||||
ToastUtils.showShort(R.string.module_och_bluetooth_connected)
|
||||
OchChainLogManager.writeChainLogWriteOff("司机端核销成功","已连接成功")
|
||||
waitSendData[data] = BleManager.UUID_CHAR_WRITE
|
||||
sendData()
|
||||
|
||||
@@ -43,7 +43,8 @@ class DebugViewWatchDogFragment :
|
||||
actv_password_submit.setOnClickListener {
|
||||
val text = acet_close.text
|
||||
if(text==null||text.isEmpty()){
|
||||
ToastCharterUtils.showToastShort("请输入密码")
|
||||
// ToastCharterUtils.showToastShort("请输入密码")
|
||||
ToastCharterUtils.showToastShort(R.string.module_och_input_pwd)
|
||||
}else{
|
||||
if(text.toString() == "123987"){
|
||||
dismissAllowingStateLoss()
|
||||
@@ -52,7 +53,8 @@ class DebugViewWatchDogFragment :
|
||||
}
|
||||
ToggleDebugView.toggleDebugView.toggle(requireContext())
|
||||
}else{
|
||||
ToastCharterUtils.showToastShort("请输入正确密码")
|
||||
// ToastCharterUtils.showToastShort("请输入正确密码")
|
||||
ToastCharterUtils.showToastShort(R.string.module_och_input_pwd_error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.utils.PermissionUtil
|
||||
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
|
||||
import io.reactivex.Observable
|
||||
@@ -36,9 +38,11 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
|
||||
return@observable
|
||||
}
|
||||
if (newValue) {
|
||||
ToastCharterUtils.showToastLong("长链接状态恢复")
|
||||
// ToastCharterUtils.showToastLong("长链接状态恢复")
|
||||
ToastCharterUtils.showToastLong(R.string.module_och_long_link_status_restored)
|
||||
} else {
|
||||
ToastCharterUtils.showToastLong("长链接异常,请开启相应权限或者查看网络")
|
||||
// ToastCharterUtils.showToastLong("长链接异常,请开启相应权限或者查看网络")
|
||||
ToastCharterUtils.showToastLong(R.string.module_och_long_link_error)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,13 +86,16 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
|
||||
//长链接状态 socketStatus
|
||||
|
||||
var toastStr = ""
|
||||
if (!locationStatusPermsStatus) toastStr += "定位服务异常 "
|
||||
if (!networkStatus) toastStr += " 网络异常 "
|
||||
// if (!locationStatusPermsStatus) toastStr += "定位服务异常 "
|
||||
if (!locationStatusPermsStatus) toastStr += StringUtils.getString(R.string.module_och_location_service_error)
|
||||
// if (!networkStatus) toastStr += " 网络异常 "
|
||||
if (!networkStatus) toastStr += StringUtils.getString(R.string.module_och_network_service_error)
|
||||
|
||||
i(TAG, "abnormal_factors_Str = $toastStr")
|
||||
|
||||
if (!FunctionBuildConfig.isDemoMode && toastStr !== "") {
|
||||
ToastCharterUtils.showToastLong(toastStr + "请开启相应权限或者查看网络")
|
||||
// ToastCharterUtils.showToastLong(toastStr + "请开启相应权限或者查看网络")
|
||||
ToastCharterUtils.showToastLong(R.string.module_och_please_open_permission, toastStr)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.permissions.PermissionsDialogUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.utils.PermissionUtil
|
||||
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
|
||||
import com.mogo.tts.base.zhi.AsrTextBean
|
||||
@@ -165,7 +166,8 @@ object ZhiStateManager : ZhiRecordWinUi {
|
||||
return
|
||||
}
|
||||
if (!isFastClick()) {
|
||||
ToastCharterUtils.showToastShort("请稍后唤醒")
|
||||
// ToastCharterUtils.showToastShort("请稍后唤醒")
|
||||
ToastCharterUtils.showToastShort(R.string.module_och_please_wait_wake_up)
|
||||
return
|
||||
}
|
||||
if (PermissionUtil.checkPermission(AbsMogoApplication.getApp(), Manifest.permission.RECORD_AUDIO)) {
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.och.common.module.R;
|
||||
import com.mogo.och.common.module.utils.PermissionUtil;
|
||||
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils;
|
||||
|
||||
@@ -175,14 +176,16 @@ public class AmapNaviToDestinationModel implements AMapNaviListener {
|
||||
}
|
||||
}
|
||||
if (!NetworkUtils.isConnected(AbsMogoApplication.getApp()) || result.getErrorCode() == 2) {
|
||||
ToastCharterUtils.showToastShort("网络异常,请重试");
|
||||
// ToastCharterUtils.showToastShort("网络异常,请重试");
|
||||
ToastCharterUtils.showToastShort(R.string.module_och_network_error_retry);
|
||||
if (mNaviChangedCallback != null) {
|
||||
mNaviChangedCallback.reInitNaviAmap(isPlay, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!PermissionUtil.isLocServiceEnable(AbsMogoApplication.getApp()) || !PermissionUtil.checkPermission(AbsMogoApplication.getApp(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION})) {
|
||||
ToastCharterUtils.showToastShort("请开启车机定位后重试");
|
||||
// ToastCharterUtils.showToastShort("请开启车机定位后重试");
|
||||
ToastCharterUtils.showToastShort(R.string.module_och_open_location_permission_retry);
|
||||
if (mNaviChangedCallback != null) {
|
||||
mNaviChangedCallback.reInitNaviAmap(isPlay, false);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.och.common.module.R;
|
||||
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils;
|
||||
|
||||
public class ToastUtilsOch {
|
||||
@@ -36,7 +37,8 @@ public class ToastUtilsOch {
|
||||
|
||||
public static void toastRequestError(Context context,String failMsg){
|
||||
if (!NetworkUtils.isConnected(context)) {
|
||||
ToastCharterUtils.showToastShort("网络异常,请稍后重试");
|
||||
// ToastCharterUtils.showToastShort("网络异常,请稍后重试");
|
||||
ToastCharterUtils.showToastShort(R.string.module_och_network_error_retry1);
|
||||
}else {
|
||||
ToastCharterUtils.showToastShort(failMsg);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ class CommonFeedbackDialog : BaseFloatDialog, LifecycleObserver {
|
||||
private var listener:Listener?=null
|
||||
|
||||
private var mRunnable:Runnable= Runnable {
|
||||
ToastUtils.showLong("超时未响应,请求失败")
|
||||
// ToastUtils.showLong("超时未响应,请求失败")
|
||||
ToastUtils.showLong(R.string.module_och_timeout)
|
||||
}
|
||||
|
||||
constructor(builder: Builder, context: Context) : super(context) {
|
||||
|
||||
@@ -30,6 +30,22 @@ object ToastCharterUtils {
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun showToastLong(@StringRes resId: Int) {
|
||||
val string = StringUtils.getString(resId)
|
||||
string?.let {
|
||||
showToastLong(it)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun showToastLong(@StringRes resId: Int, vararg args: Any?) {
|
||||
val string = StringUtils.getString(resId, args)
|
||||
string?.let {
|
||||
showToastLong(it)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun showToastShort(toastText: String?){
|
||||
CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG,"showToastShort吐司内容:${toastText}")
|
||||
@@ -60,6 +76,12 @@ object ToastCharterUtils {
|
||||
}
|
||||
|
||||
|
||||
fun showCharterLongToast(@StringRes resId: Int) {
|
||||
val string = StringUtils.getString(resId)
|
||||
string?.let {
|
||||
showCharterLongToast(it)
|
||||
}
|
||||
}
|
||||
fun showCharterLongToast(toastText: String) {
|
||||
val context = ActivityUtils.getTopActivity()
|
||||
val marker = ToastCharterView(context)
|
||||
|
||||
Reference in New Issue
Block a user