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) {