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); } }