From 3d10f317371289fc94c697d7f490936ab21e91b8 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Wed, 27 Jan 2021 14:34:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0adas=E7=89=88=E6=9C=AC?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E6=B5=81=E5=90=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../och/bus/adapter/OchBusStationAdapter.java | 2 +- .../och/bus/presenter/OchBusPresenter.java | 67 ++++++++++--------- config.gradle | 2 +- 3 files changed, 39 insertions(+), 32 deletions(-) diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/adapter/OchBusStationAdapter.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/adapter/OchBusStationAdapter.java index 287805d84b..fa13136735 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/adapter/OchBusStationAdapter.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/adapter/OchBusStationAdapter.java @@ -55,7 +55,7 @@ public class OchBusStationAdapter extends RecyclerView.Adapter implements IMogoA Logger.e(TAG, "index out of station list"); return; } - RequestBody request = RequestBody.create(MediaType.get("application/json"), GsonUtil.jsonFromObject(new OchBusLeaveStationRequest(Utils.getSn(), stationList.get(currentStationIndex).getSiteId()))); - MogoApisHandler.getInstance().getApis().getNetworkApi() - .create(IOchBusApiService.class, HostConst.OCH_DOMAIN) - .leaveStation(request).subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new SubscribeImpl(RequestOptions.create(getContext())) { - @Override - public void onSuccess(BaseData o) { - super.onSuccess(o); - // 始发站改为Stoped,其他站改为Idle - stationList.get(currentStationIndex).setIsCurrentSite(STATION_STATUS_IDLE); - currentStationIndex = 0; - stationList.get(currentStationIndex).setIsCurrentSite(STATION_STATUS_STOPED); - if (mView != null) { - mView.refreshBusStations(stationList); - } - } - - @Override - public void onError(String message, int code) { - super.onError(message, code); - Logger.d(TAG, "leave station error: " + message); - } - - @Override - public void onError(Throwable e) { - super.onError(e); - Logger.e(TAG,e,"leave station exception"); - } - }); + stationList.get(currentStationIndex).setIsCurrentSite(STATION_STATUS_IDLE); + currentStationIndex = 0; + stationList.get(currentStationIndex).setIsCurrentSite(STATION_STATUS_STOPED); + if (mView != null) { + mView.refreshBusStations(stationList); + } +// RequestBody request = RequestBody.create(MediaType.get("application/json"), GsonUtil.jsonFromObject(new OchBusLeaveStationRequest(Utils.getSn(), stationList.get(currentStationIndex).getSiteId()))); +// MogoApisHandler.getInstance().getApis().getNetworkApi() +// .create(IOchBusApiService.class, HostConst.OCH_DOMAIN) +// .leaveStation(request).subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(new SubscribeImpl(RequestOptions.create(getContext())) { +// @Override +// public void onSuccess(BaseData o) { +// super.onSuccess(o); +// // 始发站改为Stoped,其他站改为Idle +// stationList.get(currentStationIndex).setIsCurrentSite(STATION_STATUS_IDLE); +// currentStationIndex = 0; +// stationList.get(currentStationIndex).setIsCurrentSite(STATION_STATUS_STOPED); +// if (mView != null) { +// mView.refreshBusStations(stationList); +// } +// } +// +// @Override +// public void onError(String message, int code) { +// super.onError(message, code); +// Logger.d(TAG, "leave station error: " + message); +// } +// +// @Override +// public void onError(Throwable e) { +// super.onError(e); +// Logger.e(TAG,e,"leave station exception"); +// } +// }); } @Override public void onStateChanged(int state, String reason) { + Logger.d(TAG,"onStateChange: "+state); switch (state) { case IMogoAdasOCHCallback.STATUS_AUTOPILOT_ENABLE: mView.onAutopilotEnableChange(true); diff --git a/config.gradle b/config.gradle index 08bb382f78..8deb68f3da 100644 --- a/config.gradle +++ b/config.gradle @@ -157,7 +157,7 @@ ext { gpssimulatordebug : "com.mogo.module:module-gps-simulator-debug:${MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION}", gpssimulatornoop : "com.mogo.module:module-gps-simulator-noop:${MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION}", - adasapi : "com.zhidao.autopilot.support:adas:1.0.6.8", + adasapi : "com.zhidao.autopilot.support:adas:1.0.6.9", adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.1.5.2", // 个人中心的SDK