[2.11.0] 1、bus到站接口请求容错处理 2、taxi乘客屏偶现崩溃处理
This commit is contained in:
@@ -59,6 +59,7 @@ import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||
import com.mogo.och.common.module.utils.PinYinUtil;
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper;
|
||||
import com.mogo.och.common.module.utils.ToastUtilsOch;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
@@ -606,10 +607,14 @@ public class BusOrderModel {
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
}else {
|
||||
ToastUtils.showShort(failMsg);
|
||||
isArrivedStation = false;
|
||||
isGoingToNextStation = true;
|
||||
if (ToastUtilsOch.isCustomFastClick(5000)){
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
}else {
|
||||
ToastUtils.showShort(failMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -4,6 +4,11 @@ import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
|
||||
public class ToastUtilsOch {
|
||||
|
||||
private static long lastClickTime;
|
||||
// 两次点击按钮之间的点击间隔不能少于1000毫秒
|
||||
private static int MIN_CLICK_DELAY_TIME = 1000;
|
||||
|
||||
public static void showWithCodeMessage(int code,String message){
|
||||
if(message==null){
|
||||
return;
|
||||
@@ -14,4 +19,15 @@ public class ToastUtilsOch {
|
||||
ToastUtils.showShort(message);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isCustomFastClick(int customCLickDelayTime) {
|
||||
MIN_CLICK_DELAY_TIME = customCLickDelayTime;
|
||||
boolean flag = false;
|
||||
long curClickTime = System.currentTimeMillis();
|
||||
if ((curClickTime - lastClickTime) >= MIN_CLICK_DELAY_TIME) {
|
||||
flag = true;
|
||||
}
|
||||
lastClickTime = curClickTime;
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.elegant.utils.UiThreadHandler;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
@@ -159,6 +160,7 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
}
|
||||
|
||||
public void updateStartAutopilotBtnStatus(boolean isClickable){
|
||||
if (mContext == null) return;
|
||||
if (isClickable){
|
||||
mStartAutopilotBtn.setTextColor(
|
||||
mContext.getResources().getColor(R.color.taxi_p_start_autopilot_txt_color));
|
||||
@@ -259,6 +261,7 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
}
|
||||
|
||||
private void updateStatusCountDownOver() {
|
||||
if (mContext == null) return;
|
||||
isStarting = false;
|
||||
startingCarBgAnimatorDrawable(false);
|
||||
mStartAutopilotBtn.setText(
|
||||
@@ -273,4 +276,14 @@ public class TaxiPassengerStartAutopilotView extends RelativeLayout implements V
|
||||
mContext = null;
|
||||
super.onDetachedFromWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
try {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user