[fea]
[bus 代码变更]
This commit is contained in:
@@ -1,24 +1,14 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
package com.mogo.och.bus.bean
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.Serializable
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/9/23
|
||||
*/
|
||||
public class WriteOffPassenger implements Serializable {
|
||||
public String phone;
|
||||
public String orderNo;
|
||||
public int passengerSize;
|
||||
public long writeOffTime;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WriteOffPassenger{" +
|
||||
"phone='" + phone + '\'' +
|
||||
", orderNo='" + orderNo + '\'' +
|
||||
", passengerSize=" + passengerSize +
|
||||
", writeOffTime=" + writeOffTime +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
data class WriteOffPassenger(
|
||||
var phone: String? = null,
|
||||
var orderNo: String? = null,
|
||||
@JvmField var passengerSize: Int = 0,
|
||||
var writeOffTime: Long = 0
|
||||
) : Serializable
|
||||
|
||||
@@ -1,20 +1,8 @@
|
||||
package com.mogo.och.bus.bean.request;
|
||||
package com.mogo.och.bus.bean.request
|
||||
|
||||
import com.mogo.commons.storage.SharedPrefsMgr;
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
|
||||
/**
|
||||
* 中止/结束任务请求
|
||||
*/
|
||||
public class BusCloseTaskRequest {
|
||||
|
||||
private String sn;
|
||||
private int taskId;
|
||||
public BusCloseTaskRequest(int taskId) {
|
||||
this.sn = SharedPrefsMgr.getInstance().getSn();
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
}
|
||||
data class BusCloseTaskRequest(val taskId: Int, val sn: String = SharedPrefsMgr.getInstance().sn)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.bus.bean.request;
|
||||
package com.mogo.och.bus.bean.request
|
||||
|
||||
import com.mogo.commons.storage.SharedPrefsMgr;
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -8,10 +8,4 @@ import com.mogo.commons.storage.SharedPrefsMgr;
|
||||
*
|
||||
* 根据车机行驶线路站点信息
|
||||
*/
|
||||
public class BusQueryLineStationsRequest {
|
||||
|
||||
private String sn;
|
||||
public BusQueryLineStationsRequest() {
|
||||
this.sn = SharedPrefsMgr.getInstance().getSn();
|
||||
}
|
||||
}
|
||||
data class BusQueryLineStationsRequest(private val sn: String = SharedPrefsMgr.getInstance().sn)
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
package com.mogo.och.bus.bean.request;
|
||||
package com.mogo.och.bus.bean.request
|
||||
|
||||
import com.mogo.commons.storage.SharedPrefsMgr;
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/18
|
||||
*/
|
||||
public class BusResetDrivingLineRequest {
|
||||
public String sn;
|
||||
public int taskId; //切换到的线路id
|
||||
|
||||
public BusResetDrivingLineRequest(int taskId) {
|
||||
this.sn = SharedPrefsMgr.getInstance().getSn();
|
||||
this.taskId = taskId;
|
||||
}
|
||||
}
|
||||
data class BusResetDrivingLineRequest(//切换到的线路id
|
||||
val taskId: Int,
|
||||
val sn: String = SharedPrefsMgr.getInstance().sn
|
||||
)
|
||||
|
||||
@@ -1,30 +1,16 @@
|
||||
package com.mogo.och.bus.bean.request;
|
||||
|
||||
import java.util.List;
|
||||
package com.mogo.och.bus.bean.request
|
||||
|
||||
/**
|
||||
* Created by pangfan on 2021/8/19
|
||||
*
|
||||
* 订单状态更新请求数据结构
|
||||
*/
|
||||
public class BusRoutePlanningUpdateReqBean {
|
||||
public String sn;
|
||||
public int lineId;
|
||||
public int startSiteId;
|
||||
public int endSiteId;
|
||||
public List<Result> points;
|
||||
|
||||
public static class Result {
|
||||
public Double latitude;
|
||||
public Double longitude;
|
||||
}
|
||||
|
||||
public BusRoutePlanningUpdateReqBean(String sn, int lineId, int startSiteId
|
||||
, int endSiteId, List<Result> points) {
|
||||
this.sn = sn;
|
||||
this.lineId = lineId;
|
||||
this.startSiteId = startSiteId;
|
||||
this.endSiteId = endSiteId;
|
||||
this.points = points;
|
||||
}
|
||||
class BusRoutePlanningUpdateReqBean(
|
||||
var sn: String, var lineId: Int, var startSiteId: Int,
|
||||
var endSiteId: Int, var points: List<Result>
|
||||
) {
|
||||
data class Result(
|
||||
var latitude: Double? = null,
|
||||
var longitude: Double? = null
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.och.bus.bean.request;
|
||||
package com.mogo.och.bus.bean.request
|
||||
|
||||
import com.mogo.commons.storage.SharedPrefsMgr;
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -8,17 +8,9 @@ import com.mogo.commons.storage.SharedPrefsMgr;
|
||||
*
|
||||
* 小巴车运营状态请求参数
|
||||
*/
|
||||
public class BusUpdateSiteStatusRequest {
|
||||
|
||||
public String sn;
|
||||
public int taskId;
|
||||
public int seq;//站点序号
|
||||
public int siteId;//站点id
|
||||
|
||||
public BusUpdateSiteStatusRequest(int taskId,int siteId,int seq) {
|
||||
this.sn = SharedPrefsMgr.getInstance().getSn();
|
||||
this.seq = seq;
|
||||
this.siteId = siteId;
|
||||
this.taskId = taskId;
|
||||
}
|
||||
}
|
||||
class BusUpdateSiteStatusRequest(
|
||||
var taskId: Int, //站点id
|
||||
var siteId: Int, //站点序号
|
||||
var seq: Int,
|
||||
var sn: String = SharedPrefsMgr.getInstance().sn
|
||||
)
|
||||
|
||||
@@ -1,26 +1,17 @@
|
||||
package com.mogo.och.bus.bean.request;
|
||||
package com.mogo.och.bus.bean.request
|
||||
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
|
||||
import java.util.UUID;
|
||||
import com.mogo.och.bus.constant.BusConst
|
||||
import java.util.UUID
|
||||
|
||||
/**
|
||||
* Created on 2021/9/16
|
||||
*
|
||||
* 上传车机心跳信息请求数据
|
||||
*/
|
||||
public class CarHeartbeatReqBean {
|
||||
public String sn;
|
||||
public double lon; //经度
|
||||
public double lat; //纬度
|
||||
public String msgId; //心跳信息唯一标识
|
||||
public int interval; //上报间隔,单位秒,非必传,默认60秒
|
||||
|
||||
public CarHeartbeatReqBean(String sn, double lon, double lat) {
|
||||
this.sn = sn;
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
this.msgId = UUID.randomUUID().toString();
|
||||
this.interval = (int) (BusConst.LOOP_PERIOD_60S / 1000);
|
||||
}
|
||||
}
|
||||
class CarHeartbeatReqBean(
|
||||
var sn: String, //经度
|
||||
var lon: Double, //纬度
|
||||
var lat: Double,
|
||||
var msgId: String = UUID.randomUUID().toString(), //心跳信息唯一标识
|
||||
var interval: Int = (BusConst.LOOP_PERIOD_60S / 1000).toInt() //上报间隔,单位秒,非必传,默认60秒
|
||||
)
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
package com.mogo.och.bus.bean.response;
|
||||
package com.mogo.och.bus.bean.response
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/2/9
|
||||
*/
|
||||
public class BusQueryLineTaskResponse extends BaseData {
|
||||
data class BusQueryLineTaskResponse(var data: List<Result>?) : BaseData() {
|
||||
|
||||
public List<Result> data;
|
||||
|
||||
public static class Result {
|
||||
public int id;
|
||||
public long taskStartTime;
|
||||
}
|
||||
data class Result(
|
||||
var id: Int = 0,
|
||||
var taskStartTime: Long = 0,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,27 +1,22 @@
|
||||
package com.mogo.och.bus.bean.response;
|
||||
package com.mogo.och.bus.bean.response
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/2/9
|
||||
*/
|
||||
public class BusQueryLinesResponse extends BaseData {
|
||||
public List<Result> data;
|
||||
data class BusQueryLinesResponse(var data: MutableList<Result>?) : BaseData() {
|
||||
data class Result(
|
||||
var lineId: Int = 0, //线路id
|
||||
var name: String? = null, //线路名字
|
||||
var choose: Int = 0, // 1:绑定 2:未被绑定
|
||||
var startSiteName: String? = null, //始发站名称
|
||||
var endSiteName: String? = null, //终点名称
|
||||
|
||||
public static class Result {
|
||||
var open: Boolean = false, //true 打开状态 false
|
||||
var haveTask: Boolean = false,
|
||||
|
||||
public int lineId;//线路id
|
||||
public String name;//线路名字
|
||||
public int choose; // 1:绑定 2:未被绑定
|
||||
public String startSiteName;//始发站名称
|
||||
public String endSiteName;//终点名称
|
||||
|
||||
public boolean open;//true 打开状态 false
|
||||
public boolean haveTask;
|
||||
|
||||
public List<BusQueryLineTaskResponse.Result> taskList;
|
||||
}
|
||||
var taskList: MutableList<BusQueryLineTaskResponse.Result>? = null
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,28 +1,11 @@
|
||||
package com.mogo.och.bus.bean.response;
|
||||
package com.mogo.och.bus.bean.response
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.data.bean.BusRoutesResult;
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
|
||||
/**
|
||||
* 网约车小巴路线接口请求响应结果
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class BusRoutesResponse extends BaseData {
|
||||
private BusRoutesResult data;
|
||||
|
||||
public BusRoutesResult getResult() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setResult(BusRoutesResult data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusRoutesResponse{" +
|
||||
"data=" + data +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
data class BusRoutesResponse(var result: BusRoutesResult) : BaseData()
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.mogo.och.bus.callback;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/8
|
||||
*
|
||||
* Model->Presenter回调:ADAS相关(自动驾驶状态回调,到达终点等等)
|
||||
*/
|
||||
public interface IBusADASStatusCallback {
|
||||
//自驾返回失败
|
||||
void onStartAdasFailure();
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.mogo.och.bus.callback;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/10
|
||||
*
|
||||
* Model->Presenter回调:状态控制器监听(accOn、adas ui show、voice ui show、push ui show、v2x ui show等等)
|
||||
*/
|
||||
public interface IBusControllerStatusCallback {
|
||||
//开始开启自动驾驶
|
||||
void startOpenAutopilot();
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.mogo.och.bus.callback;
|
||||
|
||||
import com.mogo.och.bus.bean.WriteOffPassenger;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -8,4 +11,20 @@ import com.mogo.och.bus.bean.WriteOffPassenger;
|
||||
*/
|
||||
public interface IPassengerCallback {
|
||||
void playPassenger(WriteOffPassenger passenger);
|
||||
//自驾返回失败
|
||||
void onStartAdasFailure();
|
||||
void startOpenAutopilot();
|
||||
|
||||
void updateBusTaskStatus(String lineName,String lintTime,
|
||||
List<BusStationBean> stationList,
|
||||
int arrivingOrArrivedIndex,
|
||||
boolean isArrived);
|
||||
|
||||
/**
|
||||
* 结束清理一遍、选择任务后清理一遍
|
||||
*/
|
||||
void clearBusStationsMarkers();
|
||||
|
||||
void updateEmptyUi();
|
||||
void hideSlidePanel();
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.mogo.och.bus.callback;
|
||||
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/22
|
||||
*/
|
||||
public interface IRefreshBusStationsCallback {
|
||||
void updateBusTaskStatus(String lineName,String lintTime,
|
||||
List<BusStationBean> stationList,
|
||||
int arrivingOrArrivedIndex,
|
||||
boolean isArrived);
|
||||
|
||||
/**
|
||||
* 结束清理一遍、选择任务后清理一遍
|
||||
*/
|
||||
void clearBusStationsMarkers();
|
||||
|
||||
void updateEmptyUi();
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.mogo.och.bus.callback;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/22
|
||||
*/
|
||||
public interface ISlidePannelHideCallback {
|
||||
void hideSlidePanel();
|
||||
}
|
||||
@@ -33,11 +33,7 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.response.BusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.WriteOffPassenger;
|
||||
import com.mogo.och.bus.callback.IBusADASStatusCallback;
|
||||
import com.mogo.och.bus.callback.IBusControllerStatusCallback;
|
||||
import com.mogo.och.bus.callback.IPassengerCallback;
|
||||
import com.mogo.och.bus.callback.IRefreshBusStationsCallback;
|
||||
import com.mogo.och.bus.callback.ISlidePannelHideCallback;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
import com.mogo.och.bus.net.OrderServiceManager;
|
||||
import com.mogo.och.bus.presenter.BusModelLoopManager;
|
||||
@@ -116,11 +112,7 @@ public class OrderModel {
|
||||
// 运营类型
|
||||
private static final int VEHICLE_TYPE = 10;
|
||||
|
||||
private IRefreshBusStationsCallback refreshBusStationsCallback;
|
||||
private ISlidePannelHideCallback slidePanelHideCallback;
|
||||
private IBusControllerStatusCallback mControllerStatusCallback; //Model->Presenter:VR mode等
|
||||
private IPassengerCallback mPassengerCallback; //乘客核销回调
|
||||
private IBusADASStatusCallback mADASStatusCallback;
|
||||
|
||||
private volatile boolean isArrivedStation = false;
|
||||
|
||||
@@ -298,25 +290,10 @@ public class OrderModel {
|
||||
}
|
||||
};
|
||||
|
||||
public void setAdasStatusCallback(IBusADASStatusCallback callback){
|
||||
this.mADASStatusCallback = callback;
|
||||
}
|
||||
|
||||
public void setRefreshBusStationsCallback(IRefreshBusStationsCallback callback){
|
||||
this.refreshBusStationsCallback = callback;
|
||||
}
|
||||
|
||||
public void setPassengerCallback(IPassengerCallback callback) {
|
||||
this.mPassengerCallback = callback;
|
||||
}
|
||||
|
||||
public void setSlidePanelHideCallback(ISlidePannelHideCallback callback) {
|
||||
this.slidePanelHideCallback = callback;
|
||||
}
|
||||
|
||||
public void setControllerStatusCallback(IBusControllerStatusCallback callback) {
|
||||
this.mControllerStatusCallback = callback;
|
||||
}
|
||||
|
||||
private final ITrajectoryListener trajectoryListener = (routeArrivied, routeArriving, location) -> {
|
||||
|
||||
@@ -402,9 +379,9 @@ public class OrderModel {
|
||||
@Override
|
||||
public void onStartAutopilotFailure(@NotNull String startFailedCode, @NonNull String startFailedMessage) {
|
||||
OchAutopilotAnalytics.INSTANCE.triggerStartAutopilotFailureEventByAdas(startFailedCode, startFailedMessage, System.currentTimeMillis());
|
||||
if (mADASStatusCallback != null && !FunctionBuildConfig.isDemoMode){
|
||||
if (mPassengerCallback != null && !FunctionBuildConfig.isDemoMode){
|
||||
CallerLogger.e( M_BUS + TAG, "mAdasStartFailureListener = "+startFailedMessage );
|
||||
mADASStatusCallback.onStartAdasFailure();
|
||||
mPassengerCallback.onStartAdasFailure();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -478,8 +455,8 @@ public class OrderModel {
|
||||
|| data.getResult().getSites().isEmpty()) {
|
||||
//当为空时,显示无绑定路线图
|
||||
CallerLogger.d(M_BUS + TAG, "获取到小巴路线数据:空 ");
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.updateEmptyUi();
|
||||
if (mPassengerCallback != null) {
|
||||
mPassengerCallback.updateEmptyUi();
|
||||
}
|
||||
clearAutopilotControlParameters();
|
||||
closeBeautificationMode();
|
||||
@@ -558,14 +535,14 @@ public class OrderModel {
|
||||
if (arrivingOrArrivedStationIndex == 0 ||
|
||||
arrivingOrArrivedStation.getDrivingStatus() == STATION_STATUS_STOPPED
|
||||
&& !arrivingOrArrivedStation.isLeaving()) {
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(), lineTime,
|
||||
if (mPassengerCallback != null) {
|
||||
mPassengerCallback.updateBusTaskStatus(busRoutesResult.getName(), lineTime,
|
||||
stationList, arrivingOrArrivedStationIndex, true);
|
||||
}
|
||||
clearAutopilotControlParameters();
|
||||
} else {
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.updateBusTaskStatus(busRoutesResult.getName(), lineTime,
|
||||
if (mPassengerCallback != null) {
|
||||
mPassengerCallback.updateBusTaskStatus(busRoutesResult.getName(), lineTime,
|
||||
stationList, arrivingOrArrivedStationIndex, false);
|
||||
}
|
||||
updateAutopilotControlParameters();
|
||||
@@ -759,8 +736,8 @@ public class OrderModel {
|
||||
+ " startLatLon=" + parameters.startName + ",endLatLon=" + parameters.endName +
|
||||
"isRestart = " + isRestart);
|
||||
|
||||
if (mControllerStatusCallback != null) {
|
||||
mControllerStatusCallback.startOpenAutopilot();
|
||||
if (mPassengerCallback != null) {
|
||||
mPassengerCallback.startOpenAutopilot();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1029,8 +1006,8 @@ public class OrderModel {
|
||||
}
|
||||
|
||||
|
||||
if (currentStation.isLeaving() && slidePanelHideCallback != null) {
|
||||
slidePanelHideCallback.hideSlidePanel();
|
||||
if (currentStation.isLeaving() && mPassengerCallback != null) {
|
||||
mPassengerCallback.hideSlidePanel();
|
||||
}
|
||||
|
||||
sendTaskDetailsToClients();
|
||||
@@ -1107,8 +1084,8 @@ public class OrderModel {
|
||||
}
|
||||
|
||||
public void clearBusStationDatas() {
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.clearBusStationsMarkers();
|
||||
if (mPassengerCallback != null) {
|
||||
mPassengerCallback.clearBusStationsMarkers();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,68 +1,84 @@
|
||||
package com.mogo.och.bus.net;
|
||||
package com.mogo.och.bus.net
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.bus.bean.request.BusCloseTaskRequest;
|
||||
import com.mogo.och.bus.bean.response.BusQueryLineTaskResponse;
|
||||
import com.mogo.och.bus.bean.response.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.bean.request.BusRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.bus.bean.response.BusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.request.CarHeartbeatReqBean;
|
||||
import com.mogo.och.bus.bean.request.BusQueryLineStationsRequest;
|
||||
import com.mogo.och.bus.bean.request.BusResetDrivingLineRequest;
|
||||
import com.mogo.och.bus.bean.request.BusUpdateSiteStatusRequest;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Header;
|
||||
import retrofit2.http.Headers;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.och.bus.bean.request.BusCloseTaskRequest
|
||||
import com.mogo.och.bus.bean.request.BusQueryLineStationsRequest
|
||||
import com.mogo.och.bus.bean.request.BusResetDrivingLineRequest
|
||||
import com.mogo.och.bus.bean.request.BusRoutePlanningUpdateReqBean
|
||||
import com.mogo.och.bus.bean.request.BusUpdateSiteStatusRequest
|
||||
import com.mogo.och.bus.bean.request.CarHeartbeatReqBean
|
||||
import com.mogo.och.bus.bean.response.BusQueryLineTaskResponse
|
||||
import com.mogo.och.bus.bean.response.BusQueryLinesResponse
|
||||
import com.mogo.och.bus.bean.response.BusRoutesResponse
|
||||
import io.reactivex.Observable
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Header
|
||||
import retrofit2.http.Headers
|
||||
import retrofit2.http.POST
|
||||
import retrofit2.http.Query
|
||||
|
||||
/**
|
||||
* 小巴车相关接口
|
||||
*
|
||||
* @author tongchenfei
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* wiki: http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=48970072
|
||||
*/
|
||||
public interface IBascApiService {
|
||||
interface IBascApiService {
|
||||
/**
|
||||
* 根据车机坐标获取所在区域全部站点信息
|
||||
*
|
||||
* @param request 请求参数
|
||||
* @return 接口返回数据
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/line/v2/driver/bus/lineDataWithDriver/query" )
|
||||
Observable<BusRoutesResponse> queryBusRoutes(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusQueryLineStationsRequest request);
|
||||
@Headers("Content-Type:application/json;charset=UTF-8")
|
||||
@POST("/autopilot-car-hailing/line/v2/driver/bus/lineDataWithDriver/query")
|
||||
fun queryBusRoutes(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body request: BusQueryLineStationsRequest?
|
||||
): Observable<BusRoutesResponse>
|
||||
|
||||
/**
|
||||
* @param request 请求参数{"destLine":1,"sn":"F803EB2046PZD00229"} 这个接口是重置bus线路的, 不是重置线路中站点的
|
||||
* @return 返回值是重置后的车站列表
|
||||
* 开始路线
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/startTask" )
|
||||
Observable<BusRoutesResponse> switchLine(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusResetDrivingLineRequest request);
|
||||
@Headers("Content-Type:application/json;charset=UTF-8")
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/startTask")
|
||||
fun switchLine(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body request: BusResetDrivingLineRequest?
|
||||
): Observable<BusRoutesResponse>
|
||||
|
||||
/**
|
||||
* 离站,通知服务器
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-Type:application/json;charset=UTF-8"})
|
||||
@Headers("Content-Type:application/json;charset=UTF-8")
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/leave")
|
||||
Observable<BaseData> leaveStation(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusUpdateSiteStatusRequest request);
|
||||
fun leaveStation(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body request: BusUpdateSiteStatusRequest?
|
||||
): Observable<BaseData>
|
||||
|
||||
/**
|
||||
* 到站 更新到站信息
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/arrive")
|
||||
Observable< BaseData > arriveSiteStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body BusUpdateSiteStatusRequest request);
|
||||
fun arriveSiteStation(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body request: BusUpdateSiteStatusRequest?
|
||||
): Observable<BaseData>
|
||||
|
||||
|
||||
/**
|
||||
@@ -70,9 +86,13 @@ public interface IBascApiService {
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/location/v2/driver/bus/heartbeat" )
|
||||
Observable<BaseData> runCarHeartbeat(@Header ("appId") String appId,@Header("ticket") String ticket,@Body CarHeartbeatReqBean data);
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("/autopilot-car-hailing/location/v2/driver/bus/heartbeat")
|
||||
fun runCarHeartbeat(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body data: CarHeartbeatReqBean?
|
||||
): Observable<BaseData>
|
||||
|
||||
/**
|
||||
* 查询车辆配置的所有路线
|
||||
@@ -82,7 +102,11 @@ public interface IBascApiService {
|
||||
* @return
|
||||
*/
|
||||
@GET("/autopilot-car-hailing/line/v2/driver/bus/bindLine/query")
|
||||
Observable<BusQueryLinesResponse> queryBusLines(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
fun queryBusLines(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Query("sn") sn: String?
|
||||
): Observable<BusQueryLinesResponse>
|
||||
|
||||
/**
|
||||
* 查询路线当天的任务
|
||||
@@ -92,7 +116,7 @@ public interface IBascApiService {
|
||||
* @return
|
||||
*/
|
||||
@GET("/autopilot-car-hailing/line/v2/driver/bus/task/query")
|
||||
Observable<BusQueryLineTaskResponse> queryBusTaskByLineId(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("lineId") String lineId);
|
||||
fun queryBusTaskByLineId(@Header("appId") appId: String?, @Header("ticket") ticket: String?, @Query("lineId") lineId: String?): Observable<BusQueryLineTaskResponse>
|
||||
|
||||
|
||||
/**
|
||||
@@ -102,9 +126,13 @@ public interface IBascApiService {
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/location/v2/driver/bus/saveLineCoordinate" )
|
||||
Observable<BaseData> updateOrderRoute(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusRoutePlanningUpdateReqBean data);
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("/autopilot-car-hailing/location/v2/driver/bus/saveLineCoordinate")
|
||||
fun updateOrderRoute(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body data: BusRoutePlanningUpdateReqBean?
|
||||
): Observable<BaseData>
|
||||
|
||||
/**
|
||||
* 中止任务
|
||||
@@ -114,7 +142,11 @@ public interface IBascApiService {
|
||||
* @return
|
||||
*/
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/abortTask")
|
||||
Observable<BaseData> abortTask(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusCloseTaskRequest data);
|
||||
fun abortTask(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body data: BusCloseTaskRequest?
|
||||
): Observable<BaseData>
|
||||
|
||||
/**
|
||||
* 任务正常跑完结束
|
||||
@@ -123,8 +155,12 @@ public interface IBascApiService {
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/endTask")
|
||||
Observable<BaseData> endTask(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusCloseTaskRequest data);
|
||||
fun endTask(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body data: BusCloseTaskRequest?
|
||||
): Observable<BaseData>
|
||||
}
|
||||
|
||||
|
||||
@@ -1,67 +1,87 @@
|
||||
package com.mogo.och.bus.net;
|
||||
package com.mogo.och.bus.net
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.bus.bean.request.BusCloseTaskRequest;
|
||||
import com.mogo.och.bus.bean.response.BusQueryLineTaskResponse;
|
||||
import com.mogo.och.bus.bean.response.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.bean.request.BusResetDrivingLineRequest;
|
||||
import com.mogo.och.bus.bean.request.BusRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.bus.bean.response.BusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.request.BusUpdateSiteStatusRequest;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Header;
|
||||
import retrofit2.http.Headers;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.och.bus.bean.request.BusCloseTaskRequest
|
||||
import com.mogo.och.bus.bean.request.BusResetDrivingLineRequest
|
||||
import com.mogo.och.bus.bean.request.BusRoutePlanningUpdateReqBean
|
||||
import com.mogo.och.bus.bean.request.BusUpdateSiteStatusRequest
|
||||
import com.mogo.och.bus.bean.response.BusQueryLineTaskResponse
|
||||
import com.mogo.och.bus.bean.response.BusQueryLinesResponse
|
||||
import com.mogo.och.bus.bean.response.BusRoutesResponse
|
||||
import io.reactivex.Observable
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Header
|
||||
import retrofit2.http.Headers
|
||||
import retrofit2.http.POST
|
||||
import retrofit2.http.Query
|
||||
|
||||
/**
|
||||
* 小巴车相关接口
|
||||
*
|
||||
* @author tongchenfei
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* wiki: http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=48970072
|
||||
*/
|
||||
public interface ISAASApiService {
|
||||
interface ISAASApiService {
|
||||
/**
|
||||
* 根据车机坐标获取所在区域全部站点信息
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@GET( "/och-bus-cabin/api/business/v1/driver/bus/lineDataWithDriver/query" )
|
||||
Observable<BusRoutesResponse> queryBusRoutes(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
@Headers("Content-Type:application/json;charset=UTF-8")
|
||||
@GET("/och-bus-cabin/api/business/v1/driver/bus/lineDataWithDriver/query")
|
||||
fun queryBusRoutes(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Query("sn") sn: String?
|
||||
): Observable<BusRoutesResponse>
|
||||
|
||||
/**
|
||||
* @param request 请求参数{"destLine":1,"sn":"F803EB2046PZD00229"} 这个接口是重置bus线路的, 不是重置线路中站点的
|
||||
* @return 返回值是重置后的车站列表
|
||||
* 开始路线
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@POST( "/och-bus-cabin/cab/flow/v1/bus/driver/startTask" )
|
||||
Observable<BusRoutesResponse> switchLine(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusResetDrivingLineRequest request);
|
||||
@Headers("Content-Type:application/json;charset=UTF-8")
|
||||
@POST("/och-bus-cabin/cab/flow/v1/bus/driver/startTask")
|
||||
fun switchLine(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body request: BusResetDrivingLineRequest?
|
||||
): Observable<BusRoutesResponse>
|
||||
|
||||
/**
|
||||
* 离站,通知服务器
|
||||
*/
|
||||
@Headers({"Content-Type:application/json;charset=UTF-8"})
|
||||
@Headers("Content-Type:application/json;charset=UTF-8")
|
||||
@POST("/och-bus-cabin/cab/flow/v1/bus/driver/leave")
|
||||
Observable<BaseData> leaveStation(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusUpdateSiteStatusRequest request);
|
||||
fun leaveStation(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body request: BusUpdateSiteStatusRequest?
|
||||
): Observable<BaseData>
|
||||
|
||||
/**
|
||||
* 到站 更新到站信息
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("/och-bus-cabin/cab/flow/v1/bus/driver/arrive")
|
||||
Observable< BaseData > arriveSiteStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body BusUpdateSiteStatusRequest request);
|
||||
fun arriveSiteStation(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body request: BusUpdateSiteStatusRequest?
|
||||
): Observable<BaseData>
|
||||
|
||||
|
||||
/**
|
||||
* 查询车辆配置的所有路线
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@GET("/och-bus-cabin/api/business/v1/driver/BusBindLine")
|
||||
Observable<BusQueryLinesResponse> queryBusLines(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
fun queryBusLines(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Query("sn") sn: String?
|
||||
): Observable<BusQueryLinesResponse>
|
||||
|
||||
/**
|
||||
* 查询路线当天的任务
|
||||
@@ -70,17 +90,25 @@ public interface ISAASApiService {
|
||||
* @param lineId 线路id
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@GET("/och-bus-cabin/api/business/v1/driver/bus/task/query")
|
||||
Observable<BusQueryLineTaskResponse> queryBusTaskByLineId(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("lineId") String lineId);
|
||||
fun queryBusTaskByLineId(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Query("lineId") lineId: String?
|
||||
): Observable<BusQueryLineTaskResponse>
|
||||
|
||||
|
||||
/**
|
||||
* 上传轨迹信息
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/location/v2/driver/bus/saveLineCoordinate" )
|
||||
Observable<BaseData> updateOrderRoute(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusRoutePlanningUpdateReqBean data);
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("/autopilot-car-hailing/location/v2/driver/bus/saveLineCoordinate")
|
||||
fun updateOrderRoute(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body data: BusRoutePlanningUpdateReqBean?
|
||||
): Observable<BaseData>
|
||||
|
||||
/**
|
||||
* 中止任务
|
||||
@@ -89,9 +117,13 @@ public interface ISAASApiService {
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("/och-bus-cabin/cab/flow/v1/bus/driver/abortTask")
|
||||
Observable<BaseData> abortTask(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusCloseTaskRequest data);
|
||||
fun abortTask(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body data: BusCloseTaskRequest?
|
||||
): Observable<BaseData>
|
||||
|
||||
/**
|
||||
* 任务正常跑完结束
|
||||
@@ -100,9 +132,12 @@ public interface ISAASApiService {
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@POST("/och-bus-cabin/cab/flow/v1/bus/driver/endTask")
|
||||
Observable<BaseData> endTask(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusCloseTaskRequest data);
|
||||
|
||||
fun endTask(
|
||||
@Header("appId") appId: String?,
|
||||
@Header("ticket") ticket: String?,
|
||||
@Body data: BusCloseTaskRequest?
|
||||
): Observable<BaseData>
|
||||
}
|
||||
|
||||
|
||||
@@ -1,322 +1,259 @@
|
||||
package com.mogo.och.bus.presenter;
|
||||
package com.mogo.och.bus.presenter
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.bus.bean.WriteOffPassenger;
|
||||
import com.mogo.och.bus.callback.IBusADASStatusCallback;
|
||||
import com.mogo.och.bus.callback.IBusControllerStatusCallback;
|
||||
import com.mogo.och.bus.callback.IPassengerCallback;
|
||||
import com.mogo.och.bus.callback.IRefreshBusStationsCallback;
|
||||
import com.mogo.och.bus.callback.ISlidePannelHideCallback;
|
||||
import com.mogo.och.bus.fragment.BusFragment;
|
||||
import com.mogo.och.bus.model.OrderModel;
|
||||
import com.mogo.och.bus.util.BusTrajectoryManager;
|
||||
import com.mogo.och.bus.util.BusVoiceManager;
|
||||
import com.mogo.och.common.module.biz.login.ILoginCallback;
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusEnum;
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.bean.ArrivedStation;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bus.bean.WriteOffPassenger
|
||||
import com.mogo.och.bus.callback.IPassengerCallback
|
||||
import com.mogo.och.bus.fragment.BusFragment
|
||||
import com.mogo.och.bus.model.OrderModel
|
||||
import com.mogo.och.bus.util.BusTrajectoryManager
|
||||
import com.mogo.och.bus.util.BusVoiceManager
|
||||
import com.mogo.och.common.module.biz.login.ILoginCallback
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusEnum
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.bean.ArrivedStation
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import mogo_msg.MogoReportMsg;
|
||||
|
||||
/**
|
||||
* 网约车小巴
|
||||
*/
|
||||
public class BusPresenter extends Presenter<BusFragment>
|
||||
implements IRefreshBusStationsCallback, ISlidePannelHideCallback
|
||||
, IBusControllerStatusCallback, ILoginCallback, IPassengerCallback, IBusADASStatusCallback, IOchAutopilotStatusListener {
|
||||
class BusPresenter(view: BusFragment?) : Presenter<BusFragment?>(view), ILoginCallback,
|
||||
IPassengerCallback, IOchAutopilotStatusListener {
|
||||
private val mStationList: MutableList<BusStationBean> = ArrayList<BusStationBean>()
|
||||
private var mCurrentStation = 0
|
||||
|
||||
private static final String TAG = "BusPresenter";
|
||||
|
||||
private final List<BusStationBean> mStationList = new ArrayList<>();
|
||||
private int mCurrentStation = 0;
|
||||
|
||||
public BusPresenter(BusFragment view) {
|
||||
super(view);
|
||||
init {
|
||||
//2021.11.1 鹰眼架构整合,由IMoGoAutopilotStatusListener逐步替代IMogoAdasOCHCallback接口
|
||||
OrderModel.getInstance().init();
|
||||
OCHAdasAbilityManager.getInstance().init(AbsMogoApplication.getApp());
|
||||
|
||||
OrderModel.getInstance().init()
|
||||
OCHAdasAbilityManager.getInstance().init(AbsMogoApplication.getApp())
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@NonNull LifecycleOwner owner) {
|
||||
super.onCreate(owner);
|
||||
initModelListener();
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
super.onCreate(owner)
|
||||
initModelListener()
|
||||
|
||||
OrderModel.getInstance().queryBusCacheRoutes();
|
||||
OrderModel.getInstance().queryBusCacheRoutes()
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(@NonNull LifecycleOwner owner) {
|
||||
super.onDestroy(owner);
|
||||
OrderModel.getInstance().release();
|
||||
releaseListener();
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
super.onDestroy(owner)
|
||||
OrderModel.getInstance().release()
|
||||
releaseListener()
|
||||
}
|
||||
|
||||
public void initModelListener() {
|
||||
OrderModel.getInstance().setRefreshBusStationsCallback(this);
|
||||
OrderModel.getInstance().setSlidePanelHideCallback(this);
|
||||
OrderModel.getInstance().setControllerStatusCallback(this);
|
||||
OrderModel.getInstance().setPassengerCallback(this);
|
||||
OrderModel.getInstance().setAdasStatusCallback(this);
|
||||
OchAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
|
||||
LoginStatusManager.INSTANCE.addListener(TAG, this);
|
||||
fun initModelListener() {
|
||||
OrderModel.getInstance().setPassengerCallback(this)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
LoginStatusManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
public void releaseListener() {
|
||||
OrderModel.getInstance().setRefreshBusStationsCallback(null);
|
||||
OrderModel.getInstance().setSlidePanelHideCallback(null);
|
||||
OrderModel.getInstance().setControllerStatusCallback(null);
|
||||
OrderModel.getInstance().setPassengerCallback(null);
|
||||
OrderModel.getInstance().setAdasStatusCallback(null);
|
||||
OCHAdasAbilityManager.getInstance().release();
|
||||
OchAutoPilotStatusListenerManager.INSTANCE.removeListener(TAG);
|
||||
LoginStatusManager.INSTANCE.removeListener(TAG);
|
||||
fun releaseListener() {
|
||||
OrderModel.getInstance().setPassengerCallback(null)
|
||||
OCHAdasAbilityManager.getInstance().release()
|
||||
OchAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
LoginStatusManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
public void abortTask() {
|
||||
OrderModel.getInstance().abortTask();
|
||||
fun abortTask() {
|
||||
OrderModel.getInstance().abortTask()
|
||||
}
|
||||
|
||||
public void autoDriveToNextStation() {
|
||||
OrderModel.getInstance().autoDriveToNextStation();
|
||||
fun autoDriveToNextStation() {
|
||||
OrderModel.getInstance().autoDriveToNextStation()
|
||||
}
|
||||
|
||||
public void restartAutopilot() {
|
||||
if (OrderModel.getInstance().isGoingToNextStation()) {
|
||||
OrderModel.getInstance().restartAutopilot();
|
||||
fun restartAutopilot() {
|
||||
if (OrderModel.getInstance().isGoingToNextStation) {
|
||||
OrderModel.getInstance().restartAutopilot()
|
||||
}
|
||||
}
|
||||
|
||||
// 登出
|
||||
public void logout() {
|
||||
OrderModel.getInstance().logout();
|
||||
fun logout() {
|
||||
OrderModel.getInstance().logout()
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBusTaskStatus(String lineName, String lineTime,
|
||||
List<BusStationBean> stationList,
|
||||
int arrivingOrArrivedIndex,
|
||||
boolean isArrived) {
|
||||
mStationList.clear();
|
||||
mStationList.addAll(stationList);
|
||||
if (arrivingOrArrivedIndex == 0 || isArrived) {
|
||||
mCurrentStation = arrivingOrArrivedIndex;
|
||||
override fun updateBusTaskStatus(
|
||||
lineName: String, lineTime: String,
|
||||
stationList: List<BusStationBean>,
|
||||
arrivingOrArrivedIndex: Int,
|
||||
isArrived: Boolean
|
||||
) {
|
||||
mStationList.clear()
|
||||
mStationList.addAll(stationList)
|
||||
mCurrentStation = if (arrivingOrArrivedIndex == 0 || isArrived) {
|
||||
arrivingOrArrivedIndex
|
||||
} else {
|
||||
mCurrentStation = arrivingOrArrivedIndex - 1;
|
||||
arrivingOrArrivedIndex - 1
|
||||
}
|
||||
CallerLogger.d(M_BUS + "BusOrderModel =", " mCurrentStation =" + mCurrentStation);
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mView != null) {
|
||||
mView.updateBusTaskStatus(lineName, lineTime,
|
||||
stationList, arrivingOrArrivedIndex, isArrived);
|
||||
}
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
CallerLogger.d(
|
||||
SceneConstant.Companion.M_BUS + "BusOrderModel =",
|
||||
" mCurrentStation =$mCurrentStation"
|
||||
)
|
||||
UiThreadHandler.post({
|
||||
mView?.updateBusTaskStatus(
|
||||
lineName, lineTime,
|
||||
stationList, arrivingOrArrivedIndex, isArrived
|
||||
)
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEmptyUi() {
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mView != null) {
|
||||
mView.updateLineEmptyUI();
|
||||
}
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
override fun updateEmptyUi() {
|
||||
UiThreadHandler.post({
|
||||
mView?.updateLineEmptyUI()
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearBusStationsMarkers() {
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mView != null) {
|
||||
mView.clearBusStationsMarkers();
|
||||
}
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
override fun clearBusStationsMarkers() {
|
||||
UiThreadHandler.post({
|
||||
mView?.clearBusStationsMarkers()
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideSlidePanel() {
|
||||
if (mView != null) {
|
||||
mView.hideSlidePanel();
|
||||
mView.setArrivedClickable(true);
|
||||
}
|
||||
override fun hideSlidePanel() {
|
||||
mView?.hideSlidePanel()
|
||||
mView?.setArrivedClickable(true)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotArriveAtStation(ArrivedStation arrivedStation) {
|
||||
CallerLogger.e(M_BUS + TAG, "行程日志-onAutopilotArriveAtStation arrive");
|
||||
arriveStation(arrivedStation, "底盘触发进站");
|
||||
override fun onAutopilotArriveAtStation(arrivedStation: ArrivedStation) {
|
||||
CallerLogger.e(
|
||||
SceneConstant.Companion.M_BUS + TAG,
|
||||
"行程日志-onAutopilotArriveAtStation arrive"
|
||||
)
|
||||
arriveStation(arrivedStation, "底盘触发进站")
|
||||
}
|
||||
|
||||
public void arriveStation(ArrivedStation arrivedStation, String type) {
|
||||
OrderModel.getInstance().onArriveAt(arrivedStation, type);
|
||||
fun arriveStation(arrivedStation: ArrivedStation?, type: String?) {
|
||||
OrderModel.getInstance().onArriveAt(arrivedStation, type)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotSNRequest(@NonNull MessagePad.BasicInfoReq basicInfoReq) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(int state) {
|
||||
switch (state) {
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE:
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE:
|
||||
case IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING:
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
when (state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE, IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE, IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& (
|
||||
(mCurrentStation >= 0 && mCurrentStation <= mStationList.size() - 1)
|
||||
&& OrderModel.getInstance().isGoingToNextStation()
|
||||
)
|
||||
&& ((mCurrentStation >= 0 && mCurrentStation <= mStationList.size - 1)
|
||||
&& OrderModel.getInstance().isGoingToNextStation
|
||||
)
|
||||
) {
|
||||
CallerLogger.d(M_BUS + "BusOrderModel=", "有美化功能");
|
||||
return;
|
||||
CallerLogger.d(SceneConstant.Companion.M_BUS + "BusOrderModel=", "有美化功能")
|
||||
return
|
||||
}
|
||||
// 改变UI自动驾驶状态
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mView != null) {
|
||||
mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
|
||||
}
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
break;
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
|
||||
UiThreadHandler.post({
|
||||
mView?.onAutopilotStatusChanged(
|
||||
state,
|
||||
CallerAutoPilotControlManager.isCanStartAutopilot(false, 0)
|
||||
)
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
OrderModel.getInstance().triggerStartServiceEvent(
|
||||
OrderModel.getInstance().isRestartAutopilot(), true,0);
|
||||
OrderModel.getInstance().isRestartAutopilot, true, 0
|
||||
)
|
||||
// 改变UI自动驾驶状态
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mView != null) {
|
||||
mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
|
||||
}
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
break;
|
||||
default:
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mView != null) {
|
||||
mView.onAutopilotEnableChange(false);
|
||||
}
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
break;
|
||||
UiThreadHandler.post({
|
||||
mView?.onAutopilotStatusChanged(
|
||||
state,
|
||||
CallerAutoPilotControlManager.isCanStartAutopilot(false, 0)
|
||||
)
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
else -> UiThreadHandler.post({
|
||||
mView?.onAutopilotEnableChange(false)
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponseFromCan(int state) {
|
||||
override fun onAutopilotStatusResponseFromCan(state: Int) {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
OrderModel.getInstance().triggerStartServiceEvent(
|
||||
OrderModel.getInstance().isRestartAutopilot(), true,1);
|
||||
OrderModel.getInstance().isRestartAutopilot, true, 1
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startOpenAutopilot() {
|
||||
override fun startOpenAutopilot() {
|
||||
//非美化模式下启动动画
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mView != null) {
|
||||
mView.startAutopilotAnimation();
|
||||
}
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
UiThreadHandler.post({
|
||||
mView?.startAutopilotAnimation()
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
|
||||
//中间站点再次开启自驾时, 自动驾驶状态是2未改变, 此次鹰眼底层不再返给业务,需优化按钮动画显示
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
== CallerAutoPilotStatusListenerManager.INSTANCE.getState() && mView != null) {
|
||||
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
|
||||
== CallerAutoPilotStatusListenerManager.getState() && mView != null
|
||||
) {
|
||||
mView?.onAutopilotStatusChanged(
|
||||
CallerAutoPilotStatusListenerManager.getState(),
|
||||
CallerAutoPilotControlManager.isCanStartAutopilot(false, 0)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试使用
|
||||
*/
|
||||
public void debugAutoPilotStatus(int status) {
|
||||
onAutopilotStatusResponse(status);
|
||||
fun debugAutoPilotStatus(status: Int) {
|
||||
onAutopilotStatusResponse(status)
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo, long lineId) {
|
||||
BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo, lineId);
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?, lineId: Long) {
|
||||
BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo, lineId)
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onStatusChange(LoginStatusEnum currentStatus) {
|
||||
CallerLogger.d(M_BUS + TAG, " loginStatus =" + LoginStatusManager.isLogin());
|
||||
override fun onStatusChange(currentStatus: LoginStatusEnum) {
|
||||
CallerLogger.d(
|
||||
SceneConstant.Companion.M_BUS + TAG,
|
||||
" loginStatus =" + LoginStatusManager.isLogin()
|
||||
)
|
||||
if (LoginStatusManager.isLogin()) {
|
||||
OrderModel.getInstance().startOrStopOrderLoop(true);
|
||||
OrderModel.getInstance().queryBusCacheRoutes();
|
||||
OrderModel.getInstance().startOrStopOrderLoop(true)
|
||||
OrderModel.getInstance().queryBusCacheRoutes()
|
||||
} else {
|
||||
BusTrajectoryManager.getInstance().stopTrajReqLoop();
|
||||
OrderModel.getInstance().startOrStopOrderLoop(false);
|
||||
BusTrajectoryManager.getInstance().stopTrajReqLoop();
|
||||
clearBusStationsMarkers();
|
||||
if(mView!=null) {
|
||||
mView.hideSlidePanel();
|
||||
}
|
||||
OrderModel.getInstance().closeBeautificationMode();
|
||||
BusTrajectoryManager.getInstance().stopTrajReqLoop()
|
||||
OrderModel.getInstance().startOrStopOrderLoop(false)
|
||||
BusTrajectoryManager.getInstance().stopTrajReqLoop()
|
||||
clearBusStationsMarkers()
|
||||
mView?.hideSlidePanel()
|
||||
OrderModel.getInstance().closeBeautificationMode()
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playPassenger(WriteOffPassenger passenger) {
|
||||
int passengerNum = passenger.passengerSize;
|
||||
BusVoiceManager.INSTANCE.writeOffCount(passengerNum);
|
||||
override fun playPassenger(passenger: WriteOffPassenger) {
|
||||
val passengerNum = passenger.passengerSize
|
||||
BusVoiceManager.writeOffCount(passengerNum)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartAdasFailure() {
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(mView!=null) {
|
||||
mView.stopAnimAndUpdateBtnStatus();
|
||||
}
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
override fun onStartAdasFailure() {
|
||||
UiThreadHandler.post({
|
||||
mView?.stopAnimAndUpdateBtnStatus()
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void canStartAutopilot(boolean canStart) {
|
||||
if(mView!=null) {
|
||||
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), canStart);
|
||||
}
|
||||
override fun canStartAutopilot(canStart: Boolean) {
|
||||
mView?.onAutopilotStatusChanged(
|
||||
CallerAutoPilotStatusListenerManager.getState(),
|
||||
canStart
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "BusPresenter"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,10 +120,10 @@ class BusSwitchLineActivity : MvpActivity<BusSwitchLineView?, BusLinePresenter?>
|
||||
return
|
||||
}
|
||||
val lastCommitLineid = SharedPrefsMgr.getInstance().getInt(LASTCOMMITLINEID, -1)
|
||||
if (data.data != null && data.data.size > 0) {
|
||||
if (data.data != null && data.data.isNullOrEmpty()) {
|
||||
showNoData(false)
|
||||
mData.clear()
|
||||
mData.addAll(data.data)
|
||||
mData.addAll(data.data!!)
|
||||
mAdapter.notifyDataSetChanged()
|
||||
if(lastCommitLineid>0){
|
||||
mData.forEachIndexed { index, line ->
|
||||
@@ -157,17 +157,17 @@ class BusSwitchLineActivity : MvpActivity<BusSwitchLineView?, BusLinePresenter?>
|
||||
// 打开操作
|
||||
mAdapter.notifyItemChanged(position)
|
||||
} else {
|
||||
if (lineTaskInfo.data == null || lineTaskInfo.data.isEmpty()) {
|
||||
if (lineTaskInfo.data.isNullOrEmpty()) {
|
||||
result.haveTask = true
|
||||
lineTaskInfo.data = ArrayList()
|
||||
}
|
||||
if (lineTaskInfo.data.size != result.taskList.size) { // 不相等有变动 重新赋值
|
||||
result.taskList.clear()
|
||||
result.taskList.addAll(lineTaskInfo.data)
|
||||
if (lineTaskInfo.data!!.size != result.taskList!!.size) { // 不相等有变动 重新赋值
|
||||
result.taskList!!.clear()
|
||||
result.taskList!!.addAll(lineTaskInfo.data!!)
|
||||
if(autoRefresh) {
|
||||
mAdapter.checkTaskId = -1
|
||||
mAdapter.checkLineId = -1
|
||||
lineTaskInfo.data.forEach {
|
||||
lineTaskInfo.data?.forEach {
|
||||
if (it.id == mAdapter.checkTaskId) {
|
||||
mAdapter.checkTaskId = it.id
|
||||
mAdapter.checkLineId = result.lineId
|
||||
@@ -178,7 +178,7 @@ class BusSwitchLineActivity : MvpActivity<BusSwitchLineView?, BusLinePresenter?>
|
||||
mAdapter.notifyItemChanged(position)
|
||||
linearLayoutManager.stackFromEnd = (position==mData.size-1||position==mData.size-2)&&mData.size>6
|
||||
mLinesListView.smoothScrollToPosition(position)
|
||||
}else if(lineTaskInfo.data.isEmpty()){
|
||||
}else if(lineTaskInfo.data.isNullOrEmpty()){
|
||||
mAdapter.notifyItemChanged(position)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,15 +42,15 @@ class SwitchLineAdapter(
|
||||
override fun onBindViewHolder(holder: SwitchLineViewHolder, position: Int) {
|
||||
val currentPosition = holder.bindingAdapterPosition
|
||||
val line = mData[currentPosition]
|
||||
if(line.name!=null&&line.name.length>10){
|
||||
line.name = line.name.substring(0,10)+"…"
|
||||
if(line.name!=null&&line.name!!.length>10){
|
||||
line.name = line.name!!.substring(0,10)+"…"
|
||||
}
|
||||
holder.lineName.text = line.name
|
||||
val sb = StringBuilder()
|
||||
if (line.endSiteName!=null&&line.endSiteName.length>10) {
|
||||
sb.append(line.endSiteName.substring(0,5))
|
||||
if (line.endSiteName!=null&&line.endSiteName!!.length>10) {
|
||||
sb.append(line.endSiteName!!.substring(0,5))
|
||||
sb.append("…")
|
||||
sb.append(line.endSiteName.substring(line.endSiteName.length-5,line.endSiteName.length))
|
||||
sb.append(line.endSiteName!!.substring(line.endSiteName!!.length-5,line.endSiteName!!.length))
|
||||
}else{
|
||||
sb.append(line.endSiteName)
|
||||
}
|
||||
@@ -66,7 +66,7 @@ class SwitchLineAdapter(
|
||||
try {
|
||||
if (isCheck) {
|
||||
checkLineId = line.lineId
|
||||
checkTaskId = line.taskList[position].id
|
||||
checkTaskId = line.taskList!![position].id ?: 0
|
||||
} else {
|
||||
checkLineId = -1
|
||||
checkTaskId = -1
|
||||
@@ -83,7 +83,7 @@ class SwitchLineAdapter(
|
||||
holder.actvShowMore.visibility = View.VISIBLE
|
||||
|
||||
if(line.open){
|
||||
if(line.taskList==null||line.taskList.isEmpty()){
|
||||
if(line.taskList.isNullOrEmpty()){
|
||||
holder.actvShowMore.text = mContext.getString(R.string.bus_switch_line_no_task)
|
||||
holder.actvShowMore.setTextColor(ContextCompat.getColor(mContext,R.color.bus_color_4dffffff))
|
||||
holder.vLineTask.visibility = View.GONE
|
||||
@@ -137,7 +137,7 @@ class SwitchLineAdapter(
|
||||
result.open = false;
|
||||
notifyItemChanged(index)
|
||||
if(result.taskList!=null) {
|
||||
result.taskList.clear()
|
||||
result.taskList!!.clear()
|
||||
}
|
||||
if(index==currentPosition){// 点击当前已经打开的item 去关闭定时网络请求
|
||||
mItemClickListener?.onItemClick(currentPosition,true)
|
||||
|
||||
Reference in New Issue
Block a user