更新adas版本,修改数据流向问题

This commit is contained in:
tongchenfei
2021-01-27 14:34:14 +08:00
parent 805e18c6e3
commit 3d10f31737
3 changed files with 39 additions and 32 deletions

View File

@@ -55,7 +55,7 @@ public class OchBusStationAdapter extends RecyclerView.Adapter<OchBusStationAdap
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
Logger.d("OchBusStationAdapter", "position: " + position + " currPos: " + currentStation + " station: " + stationList.get(position));
// Logger.d("OchBusStationAdapter", "position: " + position + " currPos: " + currentStation + " station: " + stationList.get(position));
holder.tvStationName.setText(stationList.get(position).getSiteName());
if (position == currentStation) {
if(currentStation == 0){

View File

@@ -169,40 +169,47 @@ public class OchBusPresenter extends Presenter<OchBusFragment> 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<BaseData>(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<BaseData>(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);

View File

@@ -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