From eed570c859f5ac4b56c76e194e49d972ca45c9a6 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Sun, 28 Apr 2024 19:24:57 +0800 Subject: [PATCH] =?UTF-8?q?[6.4.0]=20[=E4=B8=BB=E7=BA=BF=E7=A8=8B=E5=88=A4?= =?UTF-8?q?=E7=A9=BA]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presenter/BaseBusPassengerPresenter.java | 87 ++++++++++++++----- 1 file changed, 63 insertions(+), 24 deletions(-) diff --git a/OCH/shuttle/passenger/src/main/java/jinlv/com/mogo/och/shuttle/passenger/presenter/BaseBusPassengerPresenter.java b/OCH/shuttle/passenger/src/main/java/jinlv/com/mogo/och/shuttle/passenger/presenter/BaseBusPassengerPresenter.java index 67c7a3036a..eaeb5f5878 100644 --- a/OCH/shuttle/passenger/src/main/java/jinlv/com/mogo/och/shuttle/passenger/presenter/BaseBusPassengerPresenter.java +++ b/OCH/shuttle/passenger/src/main/java/jinlv/com/mogo/och/shuttle/passenger/presenter/BaseBusPassengerPresenter.java @@ -67,17 +67,6 @@ public class BaseBusPassengerPresenter extends Presenter mView.onAutopilotStatusChanged( - IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE)); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mView.onAutopilotStatusChanged( + IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE); + } + },UiThreadHandler.MODE.QUEUE); } } @Override public void onAutopilotDisable() { if(mView != null) { - runOnUIThread(() -> mView.onAutopilotStatusChanged( - IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE)); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mView.onAutopilotStatusChanged( + IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE); + } + },UiThreadHandler.MODE.QUEUE); } } @Override public void onAutopilotRunning() { if(mView != null) { - runOnUIThread(() -> mView.onAutopilotStatusChanged( - IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING)); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mView.onAutopilotStatusChanged( + IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING); + } + },UiThreadHandler.MODE.QUEUE); } } @@ -116,14 +120,24 @@ public class BaseBusPassengerPresenter extends Presenter mView.onCarLocationChanged(location)); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mView.onCarLocationChanged(location); + } + },UiThreadHandler.MODE.QUEUE); } } @Override public void changeOperationStatus(boolean changeStatus) { if(mView != null) { - runOnUIThread(() -> mView.changeOperationStatus(changeStatus)); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mView.changeOperationStatus(changeStatus); + } + },UiThreadHandler.MODE.QUEUE); } } @@ -135,35 +149,60 @@ public class BaseBusPassengerPresenter extends Presenter mView.updateLineInfo(lineName)); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mView.updateLineInfo(lineName); + } + },UiThreadHandler.MODE.QUEUE); } } @Override public void updateStationsInfo(List stations, int currentStationIndex, boolean isArrived) { if(mView != null) { - runOnUIThread(() -> mView.updateStationsInfo(stations, currentStationIndex, isArrived)); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mView.updateStationsInfo(stations, currentStationIndex, isArrived); + } + },UiThreadHandler.MODE.QUEUE); } } @Override public void showNoTaskView() { if(mView != null) { - runOnUIThread(() -> mView.showNoTaskView()); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mView.showNoTaskView(); + } + },UiThreadHandler.MODE.QUEUE); } } @Override public void hideNoTaskView() { if(mView != null) { - runOnUIThread(() -> mView.hideNoTaskView()); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mView.hideNoTaskView(); + } + },UiThreadHandler.MODE.QUEUE); } } @Override public void routePlanningToNextStationChanged(long meters, long timeInSecond) { if(mView != null) { - runOnUIThread(() -> mView.updateRoutePlanningToNextStation(meters, timeInSecond)); + UiThreadHandler.post(new Runnable() { + @Override + public void run() { + mView.updateRoutePlanningToNextStation(meters, timeInSecond); + } + },UiThreadHandler.MODE.QUEUE); } }