From b8c9f7e3fbc42695a2dd959fd00db1afd509d63e Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Tue, 11 Jul 2023 14:34:34 +0800 Subject: [PATCH] =?UTF-8?q?[3.3.2]=20saas=E6=8E=A5=E9=A9=B3=E5=8F=B8?= =?UTF-8?q?=E6=9C=BA=E7=AB=AF=E9=80=82=E9=85=8D=E8=87=AA=E5=8A=A8=E9=A9=BE?= =?UTF-8?q?=E9=A9=B6=E7=8A=B6=E6=80=81=E8=BF=94=E5=9B=9E=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/och/bus/presenter/BusPresenter.java | 6 ++ .../res/layout/bus_p_base_fragment.xml | 8 +-- .../och/bus/fragment/BaseBusTabFragment.java | 6 +- .../mogo/och/bus/presenter/BusPresenter.java | 65 ++++--------------- 4 files changed, 27 insertions(+), 58 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 5198e4dbca..34209e95b3 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 @@ -204,6 +204,12 @@ public class BusPresenter extends Presenter public void startOpenAutopilot() { //非美化模式下启动动画 runOnUIThread(() -> mView.startAutopilotAnimation()); + + //中间站点再次开启自驾时, 自动驾驶状态是2未改变, 此次鹰眼底层不再返给业务,需优化按钮动画显示 + if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING + == CallerAutoPilotStatusListenerManager.INSTANCE.getState()){ + mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState()); + } } private void runOnUIThread(Runnable executor) { diff --git a/OCH/mogo-och-shuttle-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml b/OCH/mogo-och-shuttle-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml index aa903a44ce..c232a06a3f 100644 --- a/OCH/mogo-och-shuttle-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml +++ b/OCH/mogo-och-shuttle-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml @@ -60,10 +60,10 @@ + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toTopOf="parent" + android:layout_marginLeft="@dimen/dp_40" + android:layout_marginTop="@dimen/dp_100" /> * 展示【自动驾驶】按钮 */ public void showAutopilotBiz() { - getActivity().runOnUiThread(() -> { - ctvAutopilotStatus.setVisibility(View.VISIBLE); - }); +// getActivity().runOnUiThread(() -> { +// ctvAutopilotStatus.setVisibility(View.VISIBLE); +// }); } public SlidePanelView.OnSlidePanelMoveToEndListener getSlidePanelOnEndListener() { diff --git a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java index ea411d37b0..1d0c948311 100644 --- a/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java +++ b/OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java @@ -55,7 +55,6 @@ public class BusPresenter extends Presenter private static final String TAG = "BusPresenter"; - private int currentAutopilotStatus = -1; private List mStationList = new ArrayList<>(); private int mCurrentStation = 0; @@ -104,16 +103,12 @@ public class BusPresenter extends Presenter } public void autoDriveToNextStation() { - currentAutopilotStatus = -1; OrderModel.getInstance().autoDriveToNextStation(); -// isRestartAutopilot = false; } public void restartAutopilot() { if (OrderModel.getInstance().isGoingToNextStation()){ - currentAutopilotStatus = -1; OrderModel.getInstance().restartAutopilot(); -// isRestartAutopilot = true; } } @@ -177,34 +172,7 @@ public class BusPresenter extends Presenter public void onAutopilotStatusResponse(int state) { switch (state) { case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE: - if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) { - // 设置UI【自动驾驶】按钮是否展示 - runOnUIThread(() -> mView.onAutopilotEnableChange(true)); - } - if (FunctionBuildConfig.isDemoMode - && ( - (mCurrentStation >= 0 && mCurrentStation <= mStationList.size() - 1) - && OrderModel.getInstance().isGoingToNextStation() - ) - ) { - CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能"); - return; - } - if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) { - currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE; - } - // 改变UI自动驾驶状态 - runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus)); - break; - case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING: - if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) { - currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING; - OrderModel.getInstance().triggerStartServiceEvent( - OrderModel.getInstance().isRestartAutopilot(), true); - } - // 改变UI自动驾驶状态 - runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus)); - break; + case IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING: case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE: if (FunctionBuildConfig.isDemoMode && ( @@ -215,25 +183,14 @@ public class BusPresenter extends Presenter CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能"); return; } - if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) { - currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE; - } - runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus)); + // 改变UI自动驾驶状态 + runOnUIThread(() -> mView.onAutopilotStatusChanged(state)); break; - case IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING: - if (FunctionBuildConfig.isDemoMode - && ( - (mCurrentStation >= 0 && mCurrentStation <= mStationList.size() - 1) - && OrderModel.getInstance().isGoingToNextStation() - ) - ) { - CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能"); - return; - } - if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) { - currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING; - } - runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus)); + case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING: + OrderModel.getInstance().triggerStartServiceEvent( + OrderModel.getInstance().isRestartAutopilot(), true); + // 改变UI自动驾驶状态 + runOnUIThread(() -> mView.onAutopilotStatusChanged(state)); break; default: runOnUIThread(() -> mView.onAutopilotEnableChange(false)); @@ -257,6 +214,12 @@ public class BusPresenter extends Presenter public void startOpenAutopilot() { //非美化模式下启动动画 runOnUIThread(() -> mView.startAutopilotAnimation()); + + //中间站点再次开启自驾时, 自动驾驶状态是2未改变, 此次鹰眼底层不再返给业务,需优化按钮动画显示 + if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING + == CallerAutoPilotStatusListenerManager.INSTANCE.getState()){ + mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState()); + } } private void runOnUIThread(Runnable executor) {