From ecda801c35457b9bffb4ed586c8deec7d08e0940 Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Fri, 14 Oct 2022 16:53:06 +0800 Subject: [PATCH] =?UTF-8?q?[2.11.0]=20[fix]1=E3=80=81bus=E7=BE=8E=E5=8C=96?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E7=BB=93=E6=9D=9F=E4=BB=BB=E5=8A=A1=E8=87=AA?= =?UTF-8?q?=E9=A9=BE=E6=8C=89=E9=92=AE=E5=B1=95=E7=A4=BA=E8=B0=83=E6=95=B4?= =?UTF-8?q?=202=E3=80=81taxi=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8catch?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/och/bus/presenter/BusPresenter.java | 19 ++++----- .../taxi/ui/TaxiPersonalDialogFragment.java | 40 ++++++++++--------- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java index ace5357382..b0b1f3023e 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java @@ -56,7 +56,6 @@ public class BusPresenter extends Presenter private int currentAutopilotStatus = -1; private List mStationList = new ArrayList<>(); private int mCurrentStation = 0; -// private boolean isRestartAutopilot = false; public BusPresenter(BusFragment view) { super(view); @@ -177,9 +176,7 @@ public class BusPresenter extends Presenter currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE; // 设置UI【自动驾驶】按钮是否展示 runOnUIThread(() -> mView.onAutopilotEnableChange(true)); -// if (BusOrderModel.getInstance().isGoingToNextStation()) { -// runOnUIThread(() -> mView.hideSlidePanel()); -// } + if (FunctionBuildConfig.isDemoMode && ( (mCurrentStation >= 0 && mCurrentStation <= mStationList.size() - 1) @@ -189,9 +186,9 @@ public class BusPresenter extends Presenter CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能"); return; } - // 改变UI自动驾驶状态 - runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus)); } + // 改变UI自动驾驶状态 + runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus)); break; case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING: if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) { @@ -204,9 +201,7 @@ public class BusPresenter extends Presenter break; case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE: if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) { - if (currentAutopilotStatus == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {//2-->0语音提示 -// AIAssist.getInstance( getContext() ).speakTTSVoice( "自动驾驶已停止,请人工接管" ); - } + currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE; if (FunctionBuildConfig.isDemoMode && ( @@ -218,10 +213,10 @@ public class BusPresenter extends Presenter CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能"); return; } - runOnUIThread(() -> { - mView.onAutopilotStatusChanged(currentAutopilotStatus); - }); } + runOnUIThread(() -> { + mView.onAutopilotStatusChanged(currentAutopilotStatus); + }); break; default: runOnUIThread(() -> mView.onAutopilotEnableChange(false)); diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiPersonalDialogFragment.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiPersonalDialogFragment.java index 919214147e..5ff117c9ef 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiPersonalDialogFragment.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiPersonalDialogFragment.java @@ -266,27 +266,31 @@ public class TaxiPersonalDialogFragment extends DialogFragment implements View.O } public void onOrdersListPageRefresh(List ordersList){ - if (null == ordersList && mNextPage == 0){//无数据 - mOrdersRv.setVisibility(View.GONE); - mNoDatas.setVisibility(View.VISIBLE); - return; - } - mOrdersRv.setVisibility(View.VISIBLE); - mNoDatas.setVisibility(View.GONE); - if ((null == ordersList) || (ordersList.size() < mPerPageSize && mNextPage > 0)){//已经没有更多数据,提示无数据 - //已经没有更多数据 - serverHadNoData = true; + try { + if (null == ordersList && mNextPage == 0){//无数据 + mOrdersRv.setVisibility(View.GONE); + mNoDatas.setVisibility(View.VISIBLE); + return; + } + mOrdersRv.setVisibility(View.VISIBLE); + mNoDatas.setVisibility(View.GONE); + if ((null == ordersList) || (ordersList.size() < mPerPageSize && mNextPage > 0)){//已经没有更多数据,提示无数据 + //已经没有更多数据 + serverHadNoData = true; + orders.addAll(ordersList); + mAdapter.notifyDataSetChanged(); + mNextPage = mNextPage +1; + return; + } + serverHadNoData = false; orders.addAll(ordersList); - mAdapter.notifyDataSetChanged(); + if(mAdapter!=null) { + mAdapter.notifyDataSetChanged(); + } mNextPage = mNextPage +1; - return; + }catch (Exception e){ + e.fillInStackTrace(); } - serverHadNoData = false; - orders.addAll(ordersList); - if(mAdapter!=null) { - mAdapter.notifyDataSetChanged(); - } - mNextPage = mNextPage +1; } class OrderAdapter extends RecyclerView.Adapter{