Merge branch 'test_robobus-d-app-module_252_220215_2.5.2.1' into 'dev_robotaxi-p-app_254_220228_2.5.4'

Test robobus d app module 252 220215 2.5.2.1

See merge request zhjt/AndroidApp/MoGoEagleEye!9
This commit is contained in:
pangfan
2022-03-01 08:28:49 +00:00
39 changed files with 1113 additions and 145 deletions

View File

@@ -10,6 +10,10 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<activity android:name=".ui.BusSwitchLineActivity"
android:theme="@style/SwitchLineDialogStyle"
android:launchMode="singleTask"
android:screenOrientation="landscape" />/>
</application>
</manifest>

View File

@@ -24,7 +24,9 @@ import org.jetbrains.annotations.Nullable;
*/
@Route(path = OchBusConst.PATH)
public class OchBusProvider implements IMogoOCH {
private static final String TAG = "OchBusProvider";
private OchBusFragment busFragment;
private int containerId;
private FragmentActivity activity;
@@ -43,8 +45,10 @@ public class OchBusProvider implements IMogoOCH {
@Override
public void init(Context context) {
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus", StatusDescriptor.VR_MODE, statusChangedListener);
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus", StatusDescriptor.TOP_VIEW, statusChangedListener);
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus"
, StatusDescriptor.VR_MODE, statusChangedListener);
MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus"
, StatusDescriptor.TOP_VIEW, statusChangedListener);
}
private void showFragment() {
@@ -74,7 +78,8 @@ public class OchBusProvider implements IMogoOCH {
} else {
hideFragment();
}
} else if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() && descriptor == StatusDescriptor.TOP_VIEW) {
} else if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()
&& descriptor == StatusDescriptor.TOP_VIEW) {
// topView进行展示时推出网约车界面但是不隐藏整个fragment
if (busFragment != null && isTrue) {
busFragment.hideOchBus();

View File

@@ -0,0 +1,23 @@
package com.mogo.och.bus.bean;
import com.mogo.eagle.core.data.BaseData;
import java.util.List;
/**
* @author: wangmingjun
* @date: 2022/2/9
*/
public class BusQueryLinesResponse extends BaseData {
public List<Result> data;
public static class Result {
public int lineId;//线路id
public String name;//线路名字
public int choose; // 1:绑定 2:未被绑定
public String startSiteName;//始发站名称
public String endSiteName;//终点名称
}
}

View File

@@ -0,0 +1,12 @@
package com.mogo.och.bus.callback;
import com.mogo.och.bus.bean.BusQueryLinesResponse;
/**
* @author: wangmingjun
* @date: 2022/2/9
*/
public interface BusLinesCallback {
void onBusLinesChange(BusQueryLinesResponse lines);
void onChangeLineIdSuccess();
}

View File

@@ -67,6 +67,7 @@ public abstract class BaseOchBusTabFragment<V extends IView, P extends Presenter
private TextView mSwitchText;
private ObjectAnimator autopilotLoadingAnimator;
/**
* 滑动按钮触发的事件
*/
@@ -147,17 +148,13 @@ public abstract class BaseOchBusTabFragment<V extends IView, P extends Presenter
restartAutopilot();
});
// debug下调用测试面板
if (DebugConfig.isDebug()) {
ctvAutopilotStatus.setOnLongClickListener(v -> {
if (groupTestPanel.getVisibility() == View.VISIBLE) {
groupTestPanel.setVisibility(View.GONE);
} else {
groupTestPanel.setVisibility(View.VISIBLE);
}
return true;
});
}
// debug下调用测试面板 2022.2.25修改到 长按当前站点名字
// if (DebugConfig.isDebug()) {
// ctvAutopilotStatus.setOnLongClickListener(v -> {
// debugTestBar();
// return true;
// });
// }
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState(),false);
// 模拟 不可自动驾驶目前场景是刚开机adas还未和工控机连接
findViewById(R.id.btnAutopilotDisable).setOnClickListener(view ->
@@ -222,7 +219,6 @@ public abstract class BaseOchBusTabFragment<V extends IView, P extends Presenter
}
/**
* 展示滑动按钮
*
@@ -406,10 +402,9 @@ public abstract class BaseOchBusTabFragment<V extends IView, P extends Presenter
autopilotLoadingAnimator.setDuration(1000);//设置持续时间
}
autopilotLoadingAnimator.start();//动画开始
// autopilotLoadingAnimator.setStartDelay(500);//循环开始延迟
// }
}
/**
* 停止自动驾驶中间动画
*/
@@ -448,4 +443,15 @@ public abstract class BaseOchBusTabFragment<V extends IView, P extends Presenter
mSwitchMapModeLayout.setVisibility(View.GONE);
}
}
/**
* bus调试面板打开关闭
*/
public void debugTestBar(){
if (groupTestPanel.getVisibility() == View.VISIBLE) {
groupTestPanel.setVisibility(View.GONE);
} else {
groupTestPanel.setVisibility(View.VISIBLE);
}
}
}

View File

@@ -1,10 +1,12 @@
package com.mogo.och.bus.fragment;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
@@ -21,8 +23,11 @@ import com.mogo.och.bus.R;
import com.mogo.och.bus.bean.OchBusStation;
import com.mogo.och.bus.constant.OchBusConst;
import com.mogo.och.bus.presenter.OchBusPresenter;
import com.mogo.och.bus.ui.BusSwitchLineActivity;
import com.mogo.och.bus.view.SlidePanelView;
import org.w3c.dom.Text;
import java.util.List;
@@ -31,14 +36,17 @@ import java.util.List;
*
* @author tongchenfei
*/
public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBusPresenter > implements SlidePanelView.OnSlidePanelMoveToEndListener {
public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBusPresenter >
implements SlidePanelView.OnSlidePanelMoveToEndListener, View.OnClickListener {
private static final String TAG = "OchBusFragment";
private TextView mCurrentStationName;
private TextView mStartStationFlag;
private TextView mNextStationName;
private TextView mEndStationFlag;
private TextView mDebugArrive;
// private TextView mDebugArrive;
private TextView mSwitchLine; //切换路线
private int mCurrentStation = 0;
private View mBus;
@@ -58,8 +66,8 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
mStartStationFlag = findViewById( R.id.module_och_bus_start_station_tag );
mNextStationName = findViewById( R.id.module_och_bus_order_end_station );
mEndStationFlag = findViewById( R.id.module_och_bus_end_station_tag );
mDebugArrive = findViewById(R.id.module_och_bus_arrive_station);
mSwitchLine = findViewById(R.id.switch_line_btn);
// mDebugArrive = findViewById(R.id.module_och_bus_arrive_station);
if ( DebugConfig.isDebug() ) {
mBus.setOnClickListener( view -> {
@@ -71,25 +79,12 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
getActivity().finish();
return true;
} );
//debug下调用测试面板
mCurrentStationName.setOnLongClickListener(v -> {
debugTestBar();
return true;
});
}
mCurrentStationName.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
// if (DebugConfig.isDebug()){
if (mDebugArrive.getVisibility() == View.VISIBLE){
mDebugArrive.setVisibility(View.GONE);
}else {
mDebugArrive.setVisibility(View.VISIBLE);
}
// }
return false;
}
});
findViewById(R.id.module_och_bus_arrive_station).setOnClickListener(view ->{ //到站
mPresenter.onAutopilotArriveAtStation(null);
});
Logger.d( TAG, "initView: " + CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
// 初始化的时候设置 UI 按钮状态
@@ -108,6 +103,7 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
default:
break;
}
mSwitchLine.setOnClickListener(this);
}
@Override
@@ -132,8 +128,10 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
* @param stationList 车站列表信息
* @param currentStation 当前站点
* @param nextStation 下个站点
* @param isArrived 是否都站
*/
public void refreshBusStations( List< OchBusStation > stationList, int currentStation, int nextStation ,boolean isArrived) {
mCurrentStation = currentStation;
if ( getActivity() == null ) {
return;
}
@@ -149,9 +147,10 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
}
/**
* 重新刷新站点信息
* 重新刷新站点信息 isArrived 是否到站
*/
private void renderCurrentStationStatus( List< OchBusStation > stationList, int currentStation, int nextStation ,boolean isArrived) {
private void renderCurrentStationStatus( List< OchBusStation > stationList, int currentStation
, int nextStation ,boolean isArrived) {
Log.d("MapMaker= ","currentStation="+currentStation+",nextStation="+nextStation+"isArrived="+isArrived);
String currentStationName = null;
String nextStationName = null;
@@ -172,27 +171,35 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
if ( currentStation == 0 ) {
startStationFlagVisibility = View.VISIBLE;
isArriveAtStartStation = true;
mStartStationFlag.setText( "" );
mStartStationFlag.setText(getResources().getString(R.string.bus_arrive_to_end_start));
// Log.d("MapMaker= ","起点=");
setOrRemoveMapMaker(true, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat(),startStation.getLon(),R.drawable.icon_station_start_end);
setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat(),endStation.getLon(),R.drawable.icon_station_start_end);
setOrRemoveMapMaker(true, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat()
,startStation.getLon(),R.drawable.icon_station_start_end);
setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat()
,endStation.getLon(),R.drawable.icon_station_start_end);
} else if ( currentStation > 0 && currentStation < stationList.size() - 1 ) {// 是否到达站点
// Log.d("MapMaker= ","中间=");
isArriveAtStation = true;
setOrRemoveMapMaker(false, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat(),startStation.getLon(),R.drawable.icon_station_start_end);
setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat(),endStation.getLon(),R.drawable.icon_station_start_end);
// mStartStationFlag.setText(getResources().getString(R.string.bus_arrive_to_end_start1));
setOrRemoveMapMaker(false, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat()
,startStation.getLon(),R.drawable.icon_station_start_end);
setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat()
,endStation.getLon(),R.drawable.icon_station_start_end);
} else if ( currentStation == stationList.size() - 1 ) {// 是否到达终点
// Log.d("MapMaker= ","终点=");
isArriveEndStation = true;
nextStationName = "--";
mStartStationFlag.setText( "" );
mStartStationFlag.setText(getResources().getString(R.string.bus_arrive_to_end_end));
startStationFlagVisibility = View.VISIBLE;
endStationFlagVisibility = View.INVISIBLE;
setOrRemoveMapMaker(false, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat(),startStation.getLon(),R.drawable.icon_station_start_end);
setOrRemoveMapMaker(false, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat()
,startStation.getLon(),R.drawable.icon_station_start_end);
if (isArrived){
setOrRemoveMapMaker(false, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat(),endStation.getLon(),R.drawable.icon_station_start_end);
setOrRemoveMapMaker(false, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat()
,endStation.getLon(),R.drawable.icon_station_start_end);
}else {
setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat(),endStation.getLon(),R.drawable.icon_station_start_end);
setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat()
,endStation.getLon(),R.drawable.icon_station_start_end);
}
}
@@ -302,6 +309,7 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
mRootView.setVisibility(isVRMode ? View.VISIBLE : View.GONE);
}
}
/**
* 绘制地图起点终点
* @param isAdd
@@ -319,13 +327,34 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
options.icon(bitmap);
options.latitude(lat);
options.longitude(longi);
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).addMarker(uuid, options);
MogoApisHandler.getInstance().getApis().getMapServiceApi()
.getMarkerManager(AbsMogoApplication.getApp()).addMarker(uuid, options);
}else {
Log.d("RemoveMapMaker=",uuid+"=latitude="+lat+",longitude="+longi);
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).removeMarkers(uuid);
MogoApisHandler.getInstance().getApis().getMapServiceApi()
.getMarkerManager(AbsMogoApplication.getApp()).removeMarkers(uuid);
}
}
public void debugAutoPilotStatus(int status){
mPresenter.debugAutoPilotStatus(status);
}
@Override
public void onClick(View v) {
if (v.getId() == R.id.switch_line_btn ){//切换路线条件: 自动驾驶过程中点击则toast提示自动驾驶中不可切换路线
//本次行程未结束不支持切换路线。点击则toast提示当前行程未完成不可切换路线
if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
TipToast.longTip(getResources().getString(R.string.bus_switch_line_btn_warning1));
return;
}
if (mCurrentStation > 0){
TipToast.longTip(getResources().getString(R.string.bus_switch_line_btn_warning2));
return;
}
Intent intent = new Intent(getContext(), BusSwitchLineActivity.class);
startActivity(intent);
}
}
}

View File

@@ -1,5 +1,6 @@
package com.mogo.och.bus.net;
import com.mogo.eagle.core.data.BaseData;
import com.mogo.och.bus.bean.BusQueryLinesResponse;
import com.mogo.och.bus.bean.CarHeartbeatReqBean;
import com.mogo.och.bus.bean.OchBusOperationStatusRequest;
import com.mogo.och.bus.bean.OchBusQueryLineStationsRequest;
@@ -14,6 +15,7 @@ import com.mogo.och.bus.bean.OchBusUpdateSiteStatusRequest;
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;
@@ -26,7 +28,6 @@ import retrofit2.http.Query;
* wiki: http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=48970072
*/
public interface IOchBusApiService {
/**
* 根据车机坐标获取所在区域全部站点信息
*
@@ -34,9 +35,10 @@ public interface IOchBusApiService {
* @return 接口返回数据
*/
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
@POST( "/autopilot-car-hailing/bus/api/lineDataWithDriver/query" )
// @POST( "/autopilot-car-hailing/bus/api/lineDataWithDriver/query" )
@POST( "/autopilot-car-hailing/line/v2/lineDataWithDriver/query" )
// @POST( "/mock/268/autopilot-car-hailing/bus/api/lineDataWithDriver/query" )
Observable< OchBusRoutesResponse > querySiteByCoordinate(@Body OchBusQueryLineStationsRequest request);
Observable< OchBusRoutesResponse > querySiteByCoordinate(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusQueryLineStationsRequest request);
/**
* 重置巴士路线: 点击小巴车tab 或者出车后会使用
@@ -45,9 +47,10 @@ public interface IOchBusApiService {
* @return 返回值是重置后的车站列表
*/
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
@POST( "/autopilot-car-hailing/bus/api/drivingLine/reset" )
// @POST( "/autopilot-car-hailing/bus/api/drivingLine/reset" )
@POST( "/autopilot-car-hailing/car/v2/bus/drivingLine/reset" )
// @POST( "/mock/268/autopilot-car-hailing/bus/api/drivingLine/reset" )
Observable< OchBusRoutesResponse > debugResetStationStatus(@Body OchBusResetDrivingLineRequest request);
Observable< OchBusRoutesResponse > resetStationStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Body OchBusResetDrivingLineRequest request);
/**
* 离站,通知服务器
@@ -55,9 +58,10 @@ public interface IOchBusApiService {
* @return
*/
@Headers({"Content-Type:application/json;charset=UTF-8"})
@POST("/autopilot-car-hailing/bus/api/driving/away")
// @POST("/autopilot-car-hailing/bus/api/driving/away")
@POST("/autopilot-car-hailing/car/v2/bus/driving/away")
// @POST("/mock/268/autopilot-car-hailing/bus/api/driving/away")
Observable< OchBusRoutesResponse > leaveStation(@Body OchBusUpdateSiteStatusRequest request);
Observable< OchBusRoutesResponse > leaveStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusUpdateSiteStatusRequest request);
/**
* 到站 更新到站信息
@@ -65,9 +69,10 @@ public interface IOchBusApiService {
* @return
*/
@Headers({"Content-type:application/json;charset=UTF-8"})
@POST("/autopilot-car-hailing/bus/api/driving/attachSite")
// @POST("/autopilot-car-hailing/bus/api/driving/attachSite")
@POST("/autopilot-car-hailing/order/v2/bus/driving/attachSite")
// @POST("/mock/268/autopilot-car-hailing/bus/api/driving/attachSite")
Observable< BaseData > arriveSiteStation(@Body OchBusUpdateSiteStatusRequest request);
Observable< BaseData > arriveSiteStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusUpdateSiteStatusRequest request);
/**
@@ -76,9 +81,10 @@ public interface IOchBusApiService {
* @return
*/
@Headers({"Content-type:application/json;charset=UTF-8"})
@POST("/autopilot-car-hailing/bus/api/driving/siteArrivedOrders")
// @POST("/autopilot-car-hailing/bus/api/driving/siteArrivedOrders")
@POST("/autopilot-car-hailing/order/v2/bus/driving/siteArrivedOrders")
// @POST("/mock/268/autopilot-car-hailing/bus/api/driving/siteArrivedOrders")
Observable< QueryLeaveAwayPassengersResponse > queryStationLeaveAwayPassengers(@Body QueryLeaveAwayPassengersRequest request);
Observable< QueryLeaveAwayPassengersResponse > queryStationLeaveAwayPassengers(@Header ("appId") String appId,@Header("ticket") String ticket,@Body QueryLeaveAwayPassengersRequest request);
/**
* 出车
@@ -86,9 +92,10 @@ public interface IOchBusApiService {
* @return
*/
@Headers( {"Content-type:application/json;charset=UTF-8"} )
@POST("/autopilot-car-hailing/bus/api/startTakeOrder")
// @POST("/autopilot-car-hailing/bus/api/startTakeOrder")
@POST("/autopilot-car-hailing/car/v2/bus/startTakeOrder")
// @POST("/mock/268/autopilot-car-hailing/bus/api/startTakeOrder")
Observable<BaseData> startTakeOrder(@Body OchBusOperationStatusRequest request);
Observable<BaseData> startTakeOrder(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusOperationStatusRequest request);
/**
* 收车
@@ -96,9 +103,10 @@ public interface IOchBusApiService {
* @return
*/
@Headers({"Content-type:application/json;charset=UTF-8"})
@POST("/autopilot-car-hailing/bus/api/stopTakeOrder")
// @POST("/autopilot-car-hailing/bus/api/stopTakeOrder")
@POST("/autopilot-car-hailing/car/v2/bus/stopTakeOrder")
// @POST("/mock/268/autopilot-car-hailing/bus/api/stopTakeOrder")
Observable<BaseData> stopTakeOrder(@Body OchBusOperationStatusRequest request);
Observable<BaseData> stopTakeOrder(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusOperationStatusRequest request);
/**
* 查询小巴出车/收车状态
@@ -106,14 +114,16 @@ public interface IOchBusApiService {
* @return
*/
@Headers({"Content-type:application/json;charset=UTF-8"})
@GET("/autopilot-car-hailing/bus/api/takeOrderStatus/query")
// @GET("/autopilot-car-hailing/bus/api/takeOrderStatus/query")
@GET("/autopilot-car-hailing/car/v2/bus/takeOrderStatus/query")
// @GET("/mock/268/autopilot-car-hailing/bus/api/takeOrderStatus/query")
Observable<OchBusOperationStatusResponse> queryOperationStatus(@Query("sn") String sn);
Observable<OchBusOperationStatusResponse> queryOperationStatus(@Header ("appId") String appId,@Header("ticket") String ticket,@Query("sn") String sn);
@Headers({"Content-type:application/json;charset=UTF-8"})
@GET("/autopilot-car-hailing/bus/api/servicingOrders/query")
// @GET("/autopilot-car-hailing/bus/api/servicingOrders/query")
@GET("/autopilot-car-hailing/order/v2/bus/servicingOrders/query")
// @GET("/mock/268/autopilot-car-hailing/bus/api/servicingOrders/query")
Observable<OchBusOrdersResponse> queryBusOrders(@Query("sn") String sn);
Observable<OchBusOrdersResponse> queryBusOrders(@Header ("appId") String appId,@Header("ticket") String ticket,@Query("sn") String sn);
/**
* 车机端上传心跳数据(只在出车状态时上传):包含高德坐标系经纬度
@@ -121,6 +131,11 @@ public interface IOchBusApiService {
* @return
*/
@Headers( {"Content-type:application/json;charset=UTF-8"} )
@POST( "/autopilot-car-hailing/api/v1/driver/heartbeat" )
Observable<BaseData> runCarHeartbeat(@Body CarHeartbeatReqBean data);
// @POST( "/autopilot-car-hailing/api/v1/driver/heartbeat" )
@POST( "/autopilot-car-hailing/location/v2/driver/heartbeat" )
Observable<BaseData> runCarHeartbeat(@Header ("appId") String appId,@Header("ticket") String ticket,@Body CarHeartbeatReqBean data);
@GET("/autopilot-car-hailing/line/v2/driver/bindLine/query")
Observable<BusQueryLinesResponse> queryBusLines(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
}

View File

@@ -8,6 +8,7 @@ import com.mogo.eagle.core.network.RequestOptions;
import com.mogo.eagle.core.network.SubscribeImpl;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.och.bus.bean.BusQueryLinesResponse;
import com.mogo.och.bus.bean.CarHeartbeatReqBean;
import com.mogo.och.bus.bean.OchBusOperationStatusRequest;
import com.mogo.och.bus.bean.OchBusOperationStatusResponse;
@@ -29,18 +30,22 @@ import io.reactivex.schedulers.Schedulers;
* @date: 2021/10/20
*/
public class OCHBusServiceManager {
private static final String TAG = OCHBusServiceManager.class.getSimpleName();
private IOchBusApiService mService;
private static final String TAG = OCHBusServiceManager.class.getSimpleName();
private IOchBusApiService mService;
private String baseUrl = OchBusConst.getBaseUrl();
private static final class SingletonHolder {
private static final OCHBusServiceManager INSTANCE = new OCHBusServiceManager();
}
public static OCHBusServiceManager getInstance(){
return SingletonHolder.INSTANCE;
}
private OCHBusServiceManager(){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
/**
@@ -54,7 +59,10 @@ public class OCHBusServiceManager {
}
//获取当前高德坐标
mService.querySiteByCoordinate( new OchBusQueryLineStationsRequest(OchBusOrderModel.getInstance().mLongitude,OchBusOrderModel.getInstance().mLatitude,true))
mService.querySiteByCoordinate(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
,MoGoAiCloudClientConfig.getInstance().getToken()
, new OchBusQueryLineStationsRequest(OchBusOrderModel.getInstance().mLongitude
,OchBusOrderModel.getInstance().mLatitude,true))
.subscribeOn( Schedulers.io() ).observeOn( AndroidSchedulers.mainThread() )
.subscribe( getSubscribeImpl(context,callback,"querySiteByCoordinate"));
}
@@ -65,11 +73,12 @@ public class OCHBusServiceManager {
* @param lineId
* @param callback
*/
public void debugResetStationStatus(Context context,int lineId,OCHServiceCallback<OchBusRoutesResponse> callback){
public void resetStationStatus(Context context, int lineId, OCHServiceCallback<OchBusRoutesResponse> callback){
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
mService.debugResetStationStatus(new OchBusResetDrivingLineRequest(lineId))
mService.resetStationStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
,MoGoAiCloudClientConfig.getInstance().getToken(),new OchBusResetDrivingLineRequest(lineId))
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(getSubscribeImpl(context,callback,"debugResetStationStatus"));
}
@@ -85,7 +94,10 @@ public class OCHBusServiceManager {
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
mService.leaveStation(new OchBusUpdateSiteStatusRequest(seq,siteId,OchBusOrderModel.getInstance().mLongitude,OchBusOrderModel.getInstance().mLatitude))
mService.leaveStation(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
,MoGoAiCloudClientConfig.getInstance().getToken()
,new OchBusUpdateSiteStatusRequest(seq,siteId,OchBusOrderModel.getInstance().mLongitude
,OchBusOrderModel.getInstance().mLatitude))
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe(getSubscribeImpl(context,callback,"leaveStation"));
@@ -102,7 +114,10 @@ public class OCHBusServiceManager {
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
mService.arriveSiteStation(new OchBusUpdateSiteStatusRequest(seq,siteId,OchBusOrderModel.getInstance().mLongitude,OchBusOrderModel.getInstance().mLatitude))
mService.arriveSiteStation(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
,MoGoAiCloudClientConfig.getInstance().getToken()
,new OchBusUpdateSiteStatusRequest(seq,siteId
,OchBusOrderModel.getInstance().mLongitude,OchBusOrderModel.getInstance().mLatitude))
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe(getSubscribeImpl(context,callback,"leaveStation"));
@@ -115,11 +130,13 @@ public class OCHBusServiceManager {
* @param siteId
* @param callback
*/
public void queryStationLeaveAwayPassengers(Context context,int seq,int siteId,OCHServiceCallback<QueryLeaveAwayPassengersResponse> callback){
public void queryStationLeaveAwayPassengers(Context context,int seq,int siteId
,OCHServiceCallback<QueryLeaveAwayPassengersResponse> callback){
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
mService.queryStationLeaveAwayPassengers( new QueryLeaveAwayPassengersRequest(seq,siteId))
mService.queryStationLeaveAwayPassengers( MoGoAiCloudClientConfig.getInstance().getServiceAppId()
,MoGoAiCloudClientConfig.getInstance().getToken(),new QueryLeaveAwayPassengersRequest(seq,siteId))
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe(getSubscribeImpl(context,callback,"queryStationLeaveAwayPassengers"));
@@ -134,7 +151,10 @@ public class OCHBusServiceManager {
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
mService.stopTakeOrder(new OchBusOperationStatusRequest(OchBusOrderModel.getInstance().mLongitude,OchBusOrderModel.getInstance().mLatitude))
mService.stopTakeOrder(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
,MoGoAiCloudClientConfig.getInstance().getToken()
,new OchBusOperationStatusRequest(OchBusOrderModel.getInstance().mLongitude
,OchBusOrderModel.getInstance().mLatitude))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(getSubscribeImpl(context,callback,"stopTakeOrder"));
@@ -149,7 +169,10 @@ public class OCHBusServiceManager {
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
mService.startTakeOrder(new OchBusOperationStatusRequest(OchBusOrderModel.getInstance().mLongitude,OchBusOrderModel.getInstance().mLatitude))
mService.startTakeOrder(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
,MoGoAiCloudClientConfig.getInstance().getToken()
,new OchBusOperationStatusRequest(OchBusOrderModel.getInstance().mLongitude
,OchBusOrderModel.getInstance().mLatitude))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(getSubscribeImpl(context,callback,"startTakeOrder"));
@@ -164,7 +187,8 @@ public class OCHBusServiceManager {
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
mService.queryOperationStatus(MoGoAiCloudClientConfig.getInstance().getSn())
mService.queryOperationStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
,MoGoAiCloudClientConfig.getInstance().getToken(),MoGoAiCloudClientConfig.getInstance().getSn())
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe(getSubscribeImpl(context,callback,"queryOperationStatus"));
@@ -179,12 +203,24 @@ public class OCHBusServiceManager {
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
mService.queryBusOrders(MoGoAiCloudClientConfig.getInstance().getSn())
mService.queryBusOrders(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
,MoGoAiCloudClientConfig.getInstance().getToken(),MoGoAiCloudClientConfig.getInstance().getSn())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(getSubscribeImpl(context,callback,"queryBusOrders"));
}
public void queryBusLines(Context context, OCHServiceCallback<BusQueryLinesResponse> callback){
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create(IOchBusApiService.class,baseUrl);
}
mService.queryBusLines(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
,MoGoAiCloudClientConfig.getInstance().getToken(),MoGoAiCloudClientConfig.getInstance().getSn())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(getSubscribeImpl(context,callback,"queryBusLines"));
}
/**
* 车机端上传心跳数据(只在出车状态时上传):包含高德坐标系经纬度
* @param context
@@ -198,7 +234,8 @@ public class OCHBusServiceManager {
mService = MogoApisHandler.getInstance().getApis().getNetworkApi()
.create(IOchBusApiService.class, baseUrl);
}
mService.runCarHeartbeat(new CarHeartbeatReqBean(
mService.runCarHeartbeat(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
,MoGoAiCloudClientConfig.getInstance().getToken(),new CarHeartbeatReqBean(
MoGoAiCloudClientConfig.getInstance().getSn(), lon, lat))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())

View File

@@ -0,0 +1,78 @@
package com.mogo.och.bus.presenter;
import android.content.Context;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
import com.mogo.och.bus.bean.BusQueryLinesResponse;
import com.mogo.och.bus.bean.OchBusRoutesResponse;
import com.mogo.och.bus.callback.BusLinesCallback;
import com.mogo.och.bus.net.OCHBusServiceManager;
import com.mogo.och.bus.net.OCHServiceCallback;
/**
* @author: wangmingjun
* @date: 2022/2/9
*/
public class OchBusLineModel {
private static volatile OchBusLineModel sInstance;
private Context mContext;
private BusLinesCallback mBusLinesCallback;
public static OchBusLineModel getInstance() {
if ( sInstance == null ) {
synchronized ( OchBusLineModel.class ) {
if ( sInstance == null ) {
sInstance = new OchBusLineModel();
}
}
}
return sInstance;
}
private OchBusLineModel() {
}
public void init() {
mContext = AbsMogoApplication.getApp();
}
public void setBusLinesCallback(BusLinesCallback callback){
mBusLinesCallback = callback;
}
public void queryBusLines(){
OCHBusServiceManager.getInstance().queryBusLines(mContext, new OCHServiceCallback<BusQueryLinesResponse>() {
@Override
public void onSuccess(BusQueryLinesResponse data) {
if (null == data && mBusLinesCallback != null) {
mBusLinesCallback.onBusLinesChange(null);
return;
}
if (mBusLinesCallback != null){
mBusLinesCallback.onBusLinesChange(data);
}
}
@Override
public void onFail(String failMsg) {
}
});
}
public void commitSwitchLineId(int lineId){
OCHBusServiceManager.getInstance().resetStationStatus(mContext,lineId, new OCHServiceCallback<OchBusRoutesResponse>() {
@Override
public void onSuccess(OchBusRoutesResponse o) {
if (mBusLinesCallback != null){
mBusLinesCallback.onChangeLineIdSuccess();
}
}
@Override
public void onFail(String failMsg) {
TipToast.longTip("切换路线失败");
}
});
}
}

View File

@@ -0,0 +1,61 @@
package com.mogo.och.bus.presenter;
import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
import com.mogo.commons.mvp.Presenter;
import com.mogo.och.bus.bean.BusQueryLinesResponse;
import com.mogo.och.bus.callback.BusLinesCallback;
import com.mogo.och.bus.ui.BusSwitchLineActivity;
import com.mogo.och.bus.ui.BusSwitchLineView;
/**
* @author: wangmingjun
* @date: 2022/2/9
*/
public class OchBusLinePresenter extends Presenter<BusSwitchLineView> implements BusLinesCallback {
public OchBusLinePresenter(BusSwitchLineView view) {
super(view);
OchBusLineModel.getInstance().init();
OchBusOrderModel.getInstance().init();
}
@Override
public void onCreate(@NonNull LifecycleOwner owner) {
super.onCreate(owner);
initListener();
}
private void initListener() {
OchBusLineModel.getInstance().setBusLinesCallback(this);
}
@Override
public void onBusLinesChange(BusQueryLinesResponse lines) {
mView.onBusLinesChange(lines);
}
@Override
public void onChangeLineIdSuccess() {
mView.onChangeLineIdSuccess();
}
public void queryBusLines(){
OchBusLineModel.getInstance().queryBusLines();
}
public void commitSwitchLineId(int lineId){
OchBusLineModel.getInstance().commitSwitchLineId(lineId);
}
public void queryBusRoutes(){
OchBusOrderModel.getInstance().queryBusRoutes();
}
@Override
public void onDestroy(@NonNull LifecycleOwner owner) {
super.onDestroy(owner);
OchBusLineModel.getInstance().setBusLinesCallback(null);
}
}

View File

@@ -107,6 +107,7 @@ public class OchBusOrderModel {
return false;
}
});
public static OchBusOrderModel getInstance() {
if ( sInstance == null ) {
synchronized ( OchBusOrderModel.class ) {
@@ -121,6 +122,7 @@ public class OchBusOrderModel {
private OchBusOrderModel() {
}
public void init() {
mContext = AbsMogoApplication.getApp();
// 2021/10/20 衡阳小巴业务使用LenovoPad时需要此app自己获取坐标并上传
@@ -138,7 +140,8 @@ public class OchBusOrderModel {
//2022.1.28
// 调用Disposable.dispose() 时候会出现InterruptedException 导致出现崩溃
// The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the excTeption has nowhere to go to begin with
// The exception could not be delivered to the consumer because it has already canceled/disposed
// the flow or the excTeption has nowhere to go to begin with
RxJavaPlugins.setErrorHandler(new Consumer<Throwable>() {
@Override
public void accept(Throwable e) {
@@ -179,15 +182,19 @@ public class OchBusOrderModel {
public void setCarOperationStatusCallback(CarOperationStatusCallback callback){
this.carOperationStatusCallback = callback;
}
public void setRefreshBusStationsCallback(RefreshBusStationsCallback callback){
this.refreshBusStationsCallback = callback;
}
public void setSlidePannelHideCallback(SlidePannelHideCallback callback){
this.slidePannelHideCallback = callback;
}
public void setControllerStatusCallback(IOCHBusControllerStatusCallback callback) {
this.mControllerStatusCallback = callback;
}
/**
* 轮询bus待服务订单
*/
@@ -224,7 +231,8 @@ public class OchBusOrderModel {
tailNum = order.getPassengerPhone();
}
Logger.d(TAG, "TTS:" + tailNum);
AIAssist.getInstance(mContext).speakTTSVoice("接到新订单,尾号 " + tailNum + " 上车站点为 " + order.getStartStationName());
AIAssist.getInstance(mContext).speakTTSVoice("接到新订单,尾号 " + tailNum
+ " 上车站点为 " + order.getStartStationName());
prevBusOrderIds.add(order.getOrderId());
} catch (Exception e) {
e.printStackTrace();
@@ -256,10 +264,12 @@ public class OchBusOrderModel {
.getRegisterCenterApi()
.unregisterCarLocationChangedListener(TAG, mCarLocationChangedListener2);
}
private Object readResolve() {
// 阻止反序列化,必须实现 Serializable 接口
return sInstance;
}
private IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() {
// VR mode变更回调
@Override
@@ -271,6 +281,7 @@ public class OchBusOrderModel {
}
}
};
// 自车定位
private IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() {
@@ -303,6 +314,7 @@ public class OchBusOrderModel {
}
}
};
/**
* 查询小巴路线
*/
@@ -334,7 +346,8 @@ public class OchBusOrderModel {
*/
public void debugResetStationStatus() {
Logger.d( TAG, "测试、重置站点状态");
OCHBusServiceManager.getInstance().debugResetStationStatus(mContext, currentLineId, new OCHServiceCallback<OchBusRoutesResponse>() {
OCHBusServiceManager.getInstance().resetStationStatus(mContext, currentLineId
, new OCHServiceCallback<OchBusRoutesResponse>() {
@Override
public void onSuccess(OchBusRoutesResponse o) {
Logger.d(TAG, "获取到小巴路线数据: " + o);
@@ -353,12 +366,14 @@ public class OchBusOrderModel {
});
}
/**
* 离站上报
*/
public void leaveStation(boolean isOneWayOver,boolean isRestart){
Log.d(TAG,"leaveStation-backgroundCurrentStationIndex = "+backgroundCurrentStationIndex);
OCHBusServiceManager.getInstance().leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq(), stationList.get(backgroundCurrentStationIndex).getSiteId(), new OCHServiceCallback<OchBusRoutesResponse>() {
OCHBusServiceManager.getInstance().leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq()
, stationList.get(backgroundCurrentStationIndex).getSiteId(), new OCHServiceCallback<OchBusRoutesResponse>() {
@Override
public void onSuccess(OchBusRoutesResponse o) {
if ( o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty() ) {
@@ -385,6 +400,7 @@ public class OchBusOrderModel {
}
});
}
/**
* 离站上报成功后渲染站点
* 服务端返回的OchBusRoutesResult逻辑 离开站为当前站, 到达下一站后才会将下一站置为当前站,
@@ -405,6 +421,10 @@ public class OchBusOrderModel {
AIAssist.getInstance( mContext ).speakTTSVoice( "欢迎乘坐’蘑菇车联‘无人驾驶小巴车,请您坐好,注意乘车安全,行程即将开始" );
}
/**
* 开启自动驾驶
* @param isRestart
*/
private void startAutopilot(boolean isRestart) {
OchBusStation currentStation = stationList.get( currentStationIndex -1);
OchBusStation nextStation = stationList.get( currentStationIndex);
@@ -417,8 +437,10 @@ public class OchBusOrderModel {
currentAutopilot.isSpeakVoice = !isRestart;
currentAutopilot.startName = PinYinUtil.getPinYinHeadChar(currentStation.getName());
currentAutopilot.endName = PinYinUtil.getPinYinHeadChar(nextStation.getName());
currentAutopilot.startLatLon = new AutopilotControlParameters.AutoPilotLonLat( currentStation.getLat(), currentStation.getLon() );
currentAutopilot.endLatLon = new AutopilotControlParameters.AutoPilotLonLat( nextStation.getLat(), nextStation.getLon() );
currentAutopilot.startLatLon = new AutopilotControlParameters
.AutoPilotLonLat( currentStation.getLat(), currentStation.getLon() );
currentAutopilot.endLatLon = new AutopilotControlParameters
.AutoPilotLonLat( nextStation.getLat(), nextStation.getLon() );
currentAutopilot.vehicleType = VEHICLE_TYPE;
Logger.d( TAG, "开启自动驾驶====" + currentAutopilot.toString()
+" startLatLon="+currentStation.getName()+"endLatLon="+nextStation.getName());
@@ -433,7 +455,8 @@ public class OchBusOrderModel {
*/
private void arriveSiteStation(boolean isRestart) {
Log.d(TAG,"arriveSiteStation-currentStationIndex = "+currentStationIndex);
OCHBusServiceManager.getInstance().arriveSiteStation(mContext, stationList.get(currentStationIndex).getSeq(), stationList.get(currentStationIndex).getSiteId()
OCHBusServiceManager.getInstance().arriveSiteStation(mContext
, stationList.get(currentStationIndex).getSeq(), stationList.get(currentStationIndex).getSiteId()
, new OCHServiceCallback<BaseData>() {
@Override
public void onSuccess(BaseData o) {
@@ -457,7 +480,8 @@ public class OchBusOrderModel {
if (site != null && site.size() > 0){
backgroundCurrentStationIndex = currentStationIndex;
if (refreshBusStationsCallback != null){
refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex, getNextStopStation(),true);
refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex
, getNextStopStation(),true);
}
}
}
@@ -468,7 +492,8 @@ public class OchBusOrderModel {
private void queryStationLeaveAwayPassengers() {
Logger.d( TAG, "查询到站下车乘客");
OCHBusServiceManager.getInstance().queryStationLeaveAwayPassengers(mContext, stationList.get(currentStationIndex).getSeq(), stationList.get(currentStationIndex).getSiteId()
OCHBusServiceManager.getInstance().queryStationLeaveAwayPassengers(mContext
, stationList.get(currentStationIndex).getSeq(), stationList.get(currentStationIndex).getSiteId()
, new OCHServiceCallback<QueryLeaveAwayPassengersResponse>() {
@Override
public void onSuccess(QueryLeaveAwayPassengersResponse o) {
@@ -485,6 +510,7 @@ public class OchBusOrderModel {
}
});
}
/**
* 收车
*/
@@ -506,6 +532,7 @@ public class OchBusOrderModel {
}
});
}
/**
* 出车
*/
@@ -516,7 +543,8 @@ public class OchBusOrderModel {
mIsWorking = !mIsWorking;
startOrStopOrderLoop(mIsWorking);
if ( stationList != null && stationList.size() > 0 ) {
AIAssist.getInstance( mContext ).speakTTSVoice( "车辆已整备完毕,请前往" + stationList.get( currentStationIndex ).getName() + "站点" );
AIAssist.getInstance( mContext ).speakTTSVoice( "车辆已整备完毕,请前往"
+ stationList.get( currentStationIndex ).getName() + "站点" );
}
carOperationStatusCallback.changeOperationStatus(isWorking());
queryBusRoutes();
@@ -531,12 +559,14 @@ public class OchBusOrderModel {
}
});
}
/**
* 查询运营状态
*/
public void queryOperationStatus() {
Logger.d( TAG, "查询运营状态");
OCHBusServiceManager.getInstance().queryOperationStatus(mContext, new OCHServiceCallback<OchBusOperationStatusResponse>() {
OCHBusServiceManager.getInstance().queryOperationStatus(mContext
, new OCHServiceCallback<OchBusOperationStatusResponse>() {
@Override
public void onSuccess(OchBusOperationStatusResponse o) {
if ( o.data != null ) {
@@ -554,6 +584,7 @@ public class OchBusOrderModel {
}
});
}
/**
* 开启自动驾驶到下一站
*/
@@ -565,6 +596,7 @@ public class OchBusOrderModel {
}
leaveStation(false,isRestart);
}
/**
* 渲染站点信息
* 服务端返回的OchBusRoutesResult逻辑 离开站为当前站, 到达下一站后才会将下一站置为当前站,
@@ -592,12 +624,16 @@ public class OchBusOrderModel {
}
backgroundCurrentStationIndex = currentStationIndex;
OchBusStation currentStation = stationList.get(currentStationIndex);
Logger.d( TAG, "渲染站点信息服务端currentStationIndex="+currentStationIndex+" isLeaving()="+currentStation.isLeaving());
if (currentStationIndex == 0 && !currentStation.isLeaving()){//当前站点是始发站,告诉服务端到达始发站。 如果没有这个节点, 服务器不知道始发站到达状态,订单开始站下在始发站的状态流转有问题
Logger.d( TAG, "渲染站点信息服务端currentStationIndex="+currentStationIndex
+" isLeaving()="+currentStation.isLeaving());
//当前站点是始发站,告诉服务端到达始发站。 如果没有这个节点, 服务器不知道始发站到达状态
// ,订单开始站下在始发站的状态流转有问题
if (currentStationIndex == 0 && !currentStation.isLeaving()){
arriveSiteStation(true);
}
// 美化是否开始
if (FunctionBuildConfig.isDemoMode && ((currentStationIndex > 0 && currentStationIndex < stationList.size()-1)
if (FunctionBuildConfig.isDemoMode && ((currentStationIndex > 0
&& currentStationIndex < stationList.size()-1)
|| (stationList.get(0).isLeaving() || stationList.get(stationList.size() -1).isLeaving()))){//行驶过程中设置美化
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
Logger.d(TAG, "美化模式-ignore置为true每次滑动出发");
@@ -605,9 +641,11 @@ public class OchBusOrderModel {
if (refreshBusStationsCallback != null){
if (currentStation.isLeaving()){//如果服务端的当前站是leaving状态展示当前站需要+1
currentStationIndex ++;
refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex, getNextStopStation(),false);
refreshBusStationsCallback.refreshBusStations(stationList
, currentStationIndex, getNextStopStation(),false);
}else{
refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex, getNextStopStation(),true);
refreshBusStationsCallback.refreshBusStations(stationList
, currentStationIndex, getNextStopStation(),true);
}
}
if ( currentStation.isLeaving() && slidePannelHideCallback != null) {
@@ -635,6 +673,7 @@ public class OchBusOrderModel {
autoDriveToNextStation( true );
}
}
/**
* 根据订单状态、获取下一站靠站的的站点
*
@@ -653,6 +692,7 @@ public class OchBusOrderModel {
}
return nextStationIndex;
}
/**
* 延时查询站点信心
*/
@@ -669,6 +709,7 @@ public class OchBusOrderModel {
autoDriveToNextStation( true );
}
}
/**
* 播报下车乘客信息
*
@@ -686,7 +727,8 @@ public class OchBusOrderModel {
if ( !station.endsWith( "" ) ) {
builder.append( "" );
}
if ( awayPassengersResponse == null || awayPassengersResponse.data == null || awayPassengersResponse.data.orders == null || awayPassengersResponse.data.orders.isEmpty() ) {
if ( awayPassengersResponse == null || awayPassengersResponse.data == null
|| awayPassengersResponse.data.orders == null || awayPassengersResponse.data.orders.isEmpty() ) {
Logger.d( TAG, "播报下车乘客信息为null");
} else {
builder.append( ",请尾号为 " );
@@ -709,6 +751,7 @@ public class OchBusOrderModel {
Logger.d(TAG, "TTS:" + builder.toString());
AIAssist.getInstance( mContext ).speakTTSVoice( builder.toString() );
}
/**
* 修改小巴运营状态
*/
@@ -720,6 +763,7 @@ public class OchBusOrderModel {
startTakeOrder();
}
}
/**
* 行程结束
*/
@@ -735,9 +779,11 @@ public class OchBusOrderModel {
AIAssist.getInstance( mContext ).speakTTSVoice( "感谢您体验'蘑菇车联'无人驾驶小巴车,请您携带好随身物品,我们下次再见" );
leaveStation(true,true);
}
public boolean isWorking() {
return mIsWorking;
}
/**
* 到站
* @param data
@@ -766,6 +812,7 @@ public class OchBusOrderModel {
}
},1500);
}
public boolean isGoingToNextStation() {
return isGoingToNextStation;
}

View File

@@ -33,8 +33,12 @@ import java.util.List;
*
* @author tongchenfei
*/
public class OchBusPresenter extends Presenter< OchBusFragment > implements CarOperationStatusCallback, RefreshBusStationsCallback, SlidePannelHideCallback, IMoGoAutopilotStatusListener, IOCHBusControllerStatusCallback {
public class OchBusPresenter extends Presenter< OchBusFragment >
implements CarOperationStatusCallback, RefreshBusStationsCallback, SlidePannelHideCallback
, IMoGoAutopilotStatusListener, IOCHBusControllerStatusCallback {
private static final String TAG = "OchBusPresenter";
private int currentAutopilotStatus = -1;
private boolean isAnimateRunning = false;
private List<OchBusStation> mStationList = new ArrayList<>();
@@ -54,38 +58,46 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements CarO
OchBusOrderModel.getInstance().queryBusRoutes();
initModelListener();
}
@Override
public void onDestroy(@NonNull LifecycleOwner owner) {
super.onDestroy(owner);
OchBusOrderModel.getInstance().release();
releaseListener();
}
public void initModelListener(){
OchBusOrderModel.getInstance().setCarOperationStatusCallback(this);
OchBusOrderModel.getInstance().setRefreshBusStationsCallback(this);
OchBusOrderModel.getInstance().setSlidePannelHideCallback(this);
OchBusOrderModel.getInstance().setControllerStatusCallback(this);
}
public void releaseListener(){
OchBusOrderModel.getInstance().setCarOperationStatusCallback(null);
OchBusOrderModel.getInstance().setRefreshBusStationsCallback(null);
OchBusOrderModel.getInstance().setSlidePannelHideCallback(null);
OchBusOrderModel.getInstance().setControllerStatusCallback(null);
}
public void queryBusRoutes(){
OchBusOrderModel.getInstance().queryBusRoutes();
}
public void debugResetStationStatus(){
OchBusOrderModel.getInstance().debugResetStationStatus();
}
public void autoDriveToNextStation(boolean isRestart){
currentAutopilotStatus = -1;
OchBusOrderModel.getInstance().autoDriveToNextStation(isRestart);
}
public void restartAutopilot(){
currentAutopilotStatus = -1;
OchBusOrderModel.getInstance().restartAutopilot();
}
public void onChangeOperationStatus(){
OchBusOrderModel.getInstance().onChangeOperationStatus();
}

View File

@@ -0,0 +1,295 @@
package com.mogo.och.bus.ui;
import android.content.Context;
import android.graphics.Point;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.commons.mvp.MvpActivity;
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
import com.mogo.och.bus.R;
import com.mogo.och.bus.bean.BusQueryLinesResponse;
import com.mogo.och.bus.presenter.OchBusLinePresenter;
import java.util.ArrayList;
import java.util.List;
/**
* @author: wangmingjun
* @date: 2022/2/8
*/
public class BusSwitchLineActivity extends MvpActivity<BusSwitchLineView, OchBusLinePresenter>
implements View.OnClickListener, BusSwitchLineView {
private ImageView mClose;
private ConstraintLayout mNoDatasView;
private RecyclerView mLinesListView;
private TextView mLineCommitBtn;
private SwitchLineAdapter mAdapter;
private List<BusQueryLinesResponse.Result> mData = new ArrayList<>();
private int mSelectLineId = -1;
@Override
protected int getLayoutId() {
return R.layout.activity_bus_switch_line;
}
@NonNull
@Override
protected OchBusLinePresenter createPresenter() {
return new OchBusLinePresenter(this);
}
@Override
protected void initViews() {
initWH();
initView();
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initDatas();
}
/**
* 初始化view
*/
private void initView() {
mClose = findViewById(R.id.switch_line_close);
mClose.setOnClickListener(this);
mNoDatasView = findViewById(R.id.no_order_data_view);
mLineCommitBtn = findViewById(R.id.switch_line_btn_commit);
mLineCommitBtn.setOnClickListener(this);
mLinesListView = findViewById(R.id.switch_line_rv);
mLinesListView.setLayoutManager(new LinearLayoutManager(this));
mAdapter = new SwitchLineAdapter(this,mData);
mLinesListView.setAdapter(mAdapter);
//设置item 点击事件
mAdapter.setOnLineItemClickListener(new LineItemClickListener() {
@Override
public void onItemClick(int position) {
if (mData.size() > position && !TextUtils.isEmpty(mData.get(position).startSiteName )
&& !TextUtils.isEmpty(mData.get(position).endSiteName)){
mSelectLineId = mData.get(position).lineId;
}else {
mSelectLineId = -1;
}
}
});
}
/**
* 设置布局宽高
*/
private void initWH() {
Window window = getWindow();
WindowManager.LayoutParams params = window.getAttributes();
WindowManager windowManager = (WindowManager)getSystemService(Context.WINDOW_SERVICE);
Point point = new Point();
windowManager.getDefaultDisplay().getSize(point);//用于获取屏幕高度
params.width = (int)(point.x * 0.375);
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
window.setAttributes(params);
window.setGravity(Gravity.LEFT|Gravity.BOTTOM);
}
/**
* 初始化数据
*/
private void initDatas() {
mPresenter.queryBusLines();
}
/**
* 查询返回绑定路线集合
* @param data
*/
@Override
public void onBusLinesChange(BusQueryLinesResponse data){
if (null == data){
showNoData(true);
return;
}
if (data.data != null && data.data.size() > 0){
showNoData(false);
mData.clear();
mData.addAll(data.data);
mAdapter.notifyDataSetChanged();
changeCommitBtnBg();
}else {
showNoData(true);
}
}
/**
* 根据路线选中情况设置提交按钮样式
*/
private void changeCommitBtnBg() {
for (int i=0; i<mData.size();i++){
if (mData.get(i).choose == 1){
mLineCommitBtn.setBackgroundResource(R.drawable.bus_switch_line_btn_commit);
mLineCommitBtn.setTextColor(getResources().getColor(R.color.bus_white));
return;
}
}
}
@Override
public void onChangeLineIdSuccess(){
TipToast.longTip(getResources().getString(R.string.bus_change_line_commit_tip_s));
mPresenter.queryBusRoutes();
finish();
}
/**
* 有无数据UI显示
* @param b
*/
private void showNoData(boolean b) {
if (b){
mLinesListView.setVisibility(View.GONE);
mLineCommitBtn.setVisibility(View.GONE);
mNoDatasView.setVisibility(View.VISIBLE);
}else {
mLinesListView.setVisibility(View.VISIBLE);
mLineCommitBtn.setVisibility(View.VISIBLE);
mNoDatasView.setVisibility(View.GONE);
}
}
@Override
public void onClick(View v) {
//关闭dialog
if (v.getId() == R.id.switch_line_close){
finish();
return;
}
//切换路线提交
if (v.getId() == R.id.switch_line_btn_commit){
if (mSelectLineId > -1){
mPresenter.commitSwitchLineId(mSelectLineId);
}else {
finish();
}
return;
}
}
@Override
protected void onDestroy() {
super.onDestroy();
if (mAdapter != null){
mAdapter.setOnLineItemClickListener(null);
}
}
/**
* 路线列表adapter
*/
static class SwitchLineAdapter extends RecyclerView.Adapter<SwitchLineViewHolder>{
private Context mContext;
private List<BusQueryLinesResponse.Result> mData;
// RecyclerView设置点击事件
private LineItemClickListener mItemClickListener ;
private int clickPos = -1;
public SwitchLineAdapter(Context context, List<BusQueryLinesResponse.Result> data){
mContext = context;
mData = data;
}
@NonNull
@Override
public SwitchLineViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(R.layout.bus_switch_line_list_item
,parent,false);
SwitchLineViewHolder viewHolder = new SwitchLineViewHolder(view);
return viewHolder;
}
@Override
public void onBindViewHolder(@NonNull SwitchLineViewHolder holder, int position) {
BusQueryLinesResponse.Result line = mData.get(position);
holder.lineName.setText(mContext.getString(R.string.bus_switch_line_name)+" "+line.name);
holder.lineStartName.setText(mContext.getString(R.string.bus_line_start)+" "+line.startSiteName);
holder.lineEndName.setText(mContext.getString(R.string.bus_line_end)+" "+line.endSiteName);
//设置item点击事件
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mItemClickListener != null){
mItemClickListener.onItemClick(position);
clickPos = position;
notifyDataSetChanged();
}
}
});
//选中绑定
if (clickPos > -1){
if (clickPos == position){
holder.selectIv.setImageResource(R.drawable.bus_selected_btn);
}else {
holder.selectIv.setImageResource(R.drawable.bus_unselect_btn);
}
}else {
if (line.choose == 1){//1:绑定 2:未绑定 默认绑定
holder.selectIv.setImageResource(R.drawable.bus_selected_btn);
}else {
holder.selectIv.setImageResource(R.drawable.bus_unselect_btn);
}
}
}
@Override
public int getItemCount() {
return mData.size();
}
public void setOnLineItemClickListener(LineItemClickListener itemClickListener){
this.mItemClickListener = itemClickListener ;
}
}
static class SwitchLineViewHolder extends RecyclerView.ViewHolder{
private ImageView selectIv;
private TextView lineName; //线路名称
private TextView lineStartName; //起点
private TextView lineEndName; //终点
public SwitchLineViewHolder(@NonNull View itemView) {
super(itemView);
selectIv = itemView.findViewById(R.id.switch_line_item_select_iv);
lineName = itemView.findViewById(R.id.switch_line_name);
lineStartName = itemView.findViewById(R.id.switch_line_start_station);
lineEndName = itemView.findViewById(R.id.switch_line_end_station);
}
}
public interface LineItemClickListener {
void onItemClick(int position) ;
}
}

View File

@@ -0,0 +1,15 @@
package com.mogo.och.bus.ui;
import com.mogo.commons.mvp.IView;
import com.mogo.och.bus.bean.BusQueryLinesResponse;
/**
* @author: wangmingjun
* @date: 2022/2/10
*/
public interface BusSwitchLineView extends IView {
void onBusLinesChange(BusQueryLinesResponse data);
void onChangeLineIdSuccess();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -2,43 +2,43 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
<gradient android:angle="315" android:endColor="#293159" android:startColor="#293159" />
</shape>
</item>
<!-- <item android:state_pressed="false">-->
<!-- <shape android:shape="rectangle">-->
<!-- <corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />-->
<!-- <gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />-->
<!-- </shape>-->
<!-- </item>-->
<!-- <item android:state_pressed="false">-->
<!-- <shape android:shape="rectangle">-->
<!-- <corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />-->
<!-- <gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />-->
<!-- </shape>-->
<!-- </item>-->
<item android:state_selected="true">
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
<gradient android:angle="315" android:endColor="#2B6EFF" android:startColor="#2B6EFF" />
</shape>
</item>
<item android:state_selected="false">
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
<gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />
</shape>
</item>
<item android:state_focused="true">
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
<gradient android:angle="315" android:endColor="#293159" android:startColor="#293159" />
</shape>
</item>
<item android:state_focused="false">
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
<gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />
<corners android:bottomLeftRadius="30px" android:bottomRightRadius="70px" android:topLeftRadius="70px" android:topRightRadius="30px" />
<gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />
</shape>
</item>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/bus_selected_btn" android:state_checked="true"/>
<item android:drawable="@drawable/bus_unselect_btn" android:state_checked="false"/>
<item android:drawable="@drawable/bus_unselect_btn"/>
</selector>

View File

@@ -2,7 +2,7 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<corners android:radius="17px" />
<corners android:radius="27px" />
<solid android:color="#3B4577"/>
</shape>
</item>
@@ -12,7 +12,7 @@
android:right="3px"
android:top="3px">
<shape>
<corners android:radius="17px" />
<corners android:radius="27px" />
<solid android:color="#3B4577"/>
</shape>
</item>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:bottomLeftRadius="27px"
android:bottomRightRadius="27px"/>
<solid android:color="#2A67EF"></solid>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="60px"/>
<gradient
android:angle="0"
android:type="linear"
android:startColor="#029DFF"
android:endColor="#0056FF" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="60px"/>
<gradient
android:angle="0"
android:type="linear"
android:startColor="#11457C"
android:endColor="#102F7C" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bus_switch_line_bg">
<View
android:id="@+id/switch_line_1"
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_50"
android:layout_marginLeft="@dimen/dp_80"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@+id/bus_lint_title"
app:layout_constraintBottom_toBottomOf="@+id/bus_lint_title"
android:background="@color/switch_line"/>
<TextView
android:id="@+id/bus_lint_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/bus_switch_line_title"
android:layout_marginLeft="@dimen/dp_113"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/dp_97"
android:textColor="@android:color/white"
android:text="@string/bus_switch_line_title"/>
<ImageView
android:id="@+id/switch_line_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/dp_67"
android:layout_marginRight="@dimen/dp_40"
android:src="@drawable/bus_switch_line_close"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/switch_line_rv"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0"
app:layout_constraintLeft_toLeftOf="@+id/switch_line_1"
app:layout_constraintTop_toBottomOf="@+id/switch_line_1"
app:layout_constraintBottom_toTopOf="@+id/switch_line_btn_commit"
android:requiresFadingEdge="vertical"
android:fadingEdgeLength="40dp"
android:layout_marginTop="@dimen/dp_50"
android:layout_marginLeft="@dimen/dp_80"
android:layout_marginBottom="@dimen/dp_30"/>
<TextView
android:id="@+id/switch_line_btn_commit"
android:layout_width="@dimen/bus_switch_line_btn_width"
android:layout_height="@dimen/bus_switch_line_btn_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginBottom="@dimen/bus_switch_line_btn_margin_b"
android:textSize="@dimen/dp_42"
android:textColor="@color/bus_switch_btn_bg_half"
android:text="@string/bus_switch_line_btn_txt"
android:visibility="gone"
android:gravity="center"
android:background="@drawable/bus_switch_line_btn_un_commit"/>
<include
android:layout_width="match_parent"
android:layout_height="wrap_content"
layout="@layout/bus_no_data_common_view"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/no_order_data_view"
android:visibility="gone">
<ImageView
android:id="@+id/no_order_data_iv"
android:layout_width="502px"
android:layout_height="455px"
android:src="@drawable/no_order_data"
android:scaleType="fitXY"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"/>
<TextView
android:id="@+id/no_order_data_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#9099BF"
android:textSize="46px"
android:gravity="center"
android:layout_marginTop="58px"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/no_order_data_iv"
android:text="@string/bus_no_line_tip"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="282px">
<ImageView
android:id="@+id/switch_line_item_select_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bus_checkbox_selector"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
<TextView
android:id="@+id/switch_line_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@+id/switch_line_item_select_iv"
android:layout_marginLeft="@dimen/dp_33"
android:textStyle="bold"
android:textColor="@android:color/white"
android:text="@string/bus_switch_line_name"
android:textSize="@dimen/dp_42" />
<TextView
android:id="@+id/switch_line_start_station"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_17"
android:layout_marginTop="@dimen/dp_30"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/bus_switch_line_start"
android:textColor="#B9C3E9"
android:textSize="@dimen/dp_36"
app:layout_constraintTop_toBottomOf="@+id/switch_line_name"
app:layout_constraintLeft_toRightOf="@+id/switch_line_start_greenDot"/>
<ImageView
android:id="@+id/switch_line_start_greenDot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/bus_icon_arrived_station"
app:layout_constraintBottom_toBottomOf="@+id/switch_line_start_station"
app:layout_constraintLeft_toLeftOf="@+id/switch_line_name"
app:layout_constraintTop_toTopOf="@+id/switch_line_start_station" />
<ImageView
android:id="@+id/switch_line_end_dotLine"
android:layout_width="wrap_content"
android:layout_height="0px"
android:scaleType="fitXY"
android:src="@drawable/bus_och_dot_line"
app:layout_constraintBottom_toTopOf="@+id/switch_line_end_blueDot"
app:layout_constraintLeft_toLeftOf="@+id/switch_line_start_greenDot"
app:layout_constraintRight_toRightOf="@+id/switch_line_start_greenDot"
app:layout_constraintTop_toBottomOf="@+id/switch_line_start_greenDot" />
<ImageView
android:id="@+id/switch_line_end_blueDot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/bus_icon_arriving_station"
app:layout_constraintBottom_toBottomOf="@+id/switch_line_end_station"
app:layout_constraintLeft_toLeftOf="@+id/switch_line_name"
app:layout_constraintTop_toTopOf="@+id/switch_line_end_station" />
<TextView
android:id="@+id/switch_line_end_station"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_17"
android:layout_marginTop="@dimen/dp_30"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/bus_switch_line_end"
android:textColor="#B9C3E9"
android:textSize="@dimen/dp_36"
app:layout_constraintLeft_toRightOf="@+id/switch_line_end_blueDot"
app:layout_constraintTop_toBottomOf="@+id/switch_line_start_station"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,24 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/module_mogo_och_autopilot_order_bg_width"
android:layout_height="@dimen/module_mogo_och_autopilot_order_bg_height"
android:background="@drawable/bus_panel_bkg"
android:orientation="vertical">
<TextView
android:id="@+id/module_och_bus_arrive_station"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bus_panel_anchor_bkg"
android:paddingBottom="2px"
android:text="到站"
android:visibility="gone"
android:paddingRight="@dimen/module_mogo_och_autopilot_order_tag_p_r"
android:paddingLeft="@dimen/module_mogo_och_autopilot_order_tag_p_r"
android:textColor="#FFF"
android:textSize="@dimen/module_mogo_och_autopilot_order_tag_height"
android:textStyle="bold" />
android:background="@drawable/bus_panel_bkg">
<!-- <TextView-->
<!-- android:id="@+id/module_och_bus_arrive_to_end_title"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="@dimen/dp_32"-->
<!-- android:layout_marginLeft="@dimen/dp_27"-->
<!-- android:text="@string/bus_arrive_to_end_title"-->
<!-- android:textColor="#FFF"-->
<!-- android:textSize="@dimen/dp_27"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- android:textStyle="bold" />-->
<!-- <View-->
<!-- android:id="@+id/module_och_bus_arrive_to_end_deviler_line"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="@dimen/dp_1"-->
<!-- android:layout_marginTop="@dimen/dp_23"-->
<!-- app:layout_constraintLeft_toLeftOf="@+id/module_och_bus_arrive_to_end_title"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/module_och_bus_arrive_to_end_title"-->
<!-- android:background="#707DBE">-->
<!-- </View>-->
<TextView
android:id="@+id/module_och_bus_tag"
android:layout_width="wrap_content"
@@ -34,17 +45,21 @@
android:text="小巴车"
android:textColor="#FFF"
android:textSize="@dimen/module_mogo_och_autopilot_order_tag_height"
android:textStyle="bold" />
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/module_och_bus_order_status_stationInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/module_och_bus_order_status_stationInfo_paddingLeft"
android:paddingTop="@dimen/module_och_bus_order_status_stationInfo_paddingTop"
android:paddingTop="8px"
android:paddingRight="@dimen/module_och_bus_order_status_stationInfo_paddingRight"
android:paddingBottom="@dimen/module_och_bus_order_status_stationInfo_paddingBottom">
android:paddingBottom="@dimen/module_och_bus_order_status_stationInfo_paddingBottom"
app:layout_constraintTop_toBottomOf="@+id/module_och_bus_tag"
app:layout_constraintLeft_toLeftOf="parent">
<TextView
android:id="@+id/module_och_bus_current_station_anchor"
@@ -154,5 +169,15 @@
app:layout_constraintTop_toTopOf="@+id/module_och_bus_order_end_station" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<TextView
android:id="@+id/switch_line_btn"
android:layout_width="@dimen/module_mogo_och_autopilot_order_bg_width"
android:layout_height="@dimen/bus_switch_line_btn"
android:text="@string/bus_switch_line_btn"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="@dimen/module_mogo_och_bus_station_notice_text_size"
android:background="@drawable/bus_switch_line_btn"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -87,7 +87,7 @@
<dimen name="module_mogo_och_autopilot_order_m_t">30px</dimen>
<dimen name="module_mogo_och_autopilot_order_bg_width">466px</dimen>
<dimen name="module_mogo_och_autopilot_order_bg_height">414px</dimen>
<dimen name="module_mogo_och_autopilot_order_bg_height">446px</dimen>
<dimen name="module_mogo_och_autopilot_status_text_size">36px</dimen>
@@ -116,4 +116,12 @@
<dimen name="bus_switch_image">50px</dimen>
<dimen name="bus_switch_image_circle">60px</dimen>
<dimen name="bus_switch_line_title">46px</dimen>
<dimen name="bus_switch_line_btn_width">700px</dimen>
<dimen name="bus_switch_line_btn_height">120px</dimen>
<dimen name="bus_switch_line_btn">86px</dimen>
<dimen name="bus_switch_line_btn_margin_b">20px</dimen>
</resources>

View File

@@ -87,7 +87,7 @@
<dimen name="module_mogo_och_autopilot_order_m_t">30px</dimen>
<dimen name="module_mogo_och_autopilot_order_bg_width">466px</dimen>
<dimen name="module_mogo_och_autopilot_order_bg_height">414px</dimen>
<dimen name="module_mogo_och_autopilot_order_bg_height">446px</dimen>
<dimen name="module_mogo_och_autopilot_status_text_size">36px</dimen>
@@ -116,4 +116,9 @@
<dimen name="bus_switch_image">50px</dimen>
<dimen name="bus_switch_image_circle">60px</dimen>
<dimen name="bus_switch_line_title">46px</dimen>
<dimen name="bus_switch_line_btn_width">700px</dimen>
<dimen name="bus_switch_line_btn_height">120px</dimen>
<dimen name="bus_switch_line_btn">86px</dimen>
<dimen name="bus_switch_line_btn_margin_b">50px</dimen>
</resources>

View File

@@ -9,4 +9,5 @@
<attr name="BLOCK_START_X" format="dimension" />
<attr name="BLOCK_START_Y" format="dimension" />
</declare-styleable>
</resources>

View File

@@ -32,5 +32,10 @@
<color name="arc_speed">#3E77F6</color>
<color name="bus_switch_map_bg_c">#323C6F</color>
<color name="switch_line">#2966EC</color>
<color name="bus_switch_line_bg">#F0151D41</color>
<color name="bus_switch_btn_bg_half">#19FFFFFF</color>
<color name="bus_white">#FFFFFF</color>
</resources>

View File

@@ -132,4 +132,9 @@
<dimen name="bus_switch_image">35px</dimen>
<dimen name="bus_ext_top_view_width_in_vr_mode">822px</dimen>
<dimen name="bus_switch_line_title">30px</dimen>
<dimen name="bus_switch_line_btn_width">450px</dimen>
<dimen name="bus_switch_line_btn_height">72px</dimen>
<dimen name="bus_switch_line_btn">52px</dimen>
<dimen name="bus_switch_line_btn_margin_b">20px</dimen>
</resources>

View File

@@ -5,4 +5,22 @@
<string name="bus_loading_autopilot_success_tv">启动成功</string>
<string name="bus_loading_autopilot_failure_tv">启动失败</string>
<string name="bus_loading_autopilot_runnig_tv">自动驾驶</string>
<string name="bus_switch_line_title">路线列表</string>
<string name="bus_switch_line_name">路线: </string>
<string name="bus_switch_line_start">起点: </string>
<string name="bus_switch_line_end">终点:</string>
<string name="bus_switch_line_btn_txt">确认</string>
<string name="bus_switch_line_btn">切换路线</string>
<string name="bus_switch_line_btn_warning1">自动驾驶中,不可切换路线</string>
<string name="bus_switch_line_btn_warning2">当前行程未完成,不可切换路线</string>
<string name="bus_no_line_tip">当前车辆无路线\n请联系运营人员绑定</string>
<string name="bus_line_start">起点: </string>
<string name="bus_line_end">终点: </string>
<string name="bus_change_line_commit_tip_s">更换路线成功</string>
<string name="bus_change_line_commit_tip_f">更换路线失败</string>
<!-- <string name="bus_arrive_to_end_title">去往下车地点</string>-->
<string name="bus_arrive_to_end_start"></string>
<!-- <string name="bus_arrive_to_end_start1">上车</string>-->
<string name="bus_arrive_to_end_end"></string>
<!-- <string name="bus_arrive_to_end_end1">下车</string>-->
</resources>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SwitchLineDialogStyle" parent="Theme.AppCompat.Dialog">
<item name="theme">@android:style/Theme.Translucent</item>
<!--是否去除标题 -->
<item name="windowNoTitle">true</item>
<!-- 背景透明 -->
<item name="android:background">#00000000</item>
<item name="android:windowBackground">#00000000</item>
<!-- 没有windowActionBar-->
<item name="windowActionBar">false</item>
<item name="android:windowContentOverlay">@null</item>
<!-- 设置窗体外面允不允许点击-->
<item name="android:windowCloseOnTouchOutside">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>

View File

@@ -91,7 +91,7 @@ applicationId=com.mogo.launcer
applicationName=IntelligentPilot
# RoboBus司机端2.5.1RoboTaxi司机端2.5.1RoboTaxi乘客端1.0.0
versionCode=80008
versionName=2.5.1
versionName=2.5.2
################# 新架构模块Maven版本管理 #################
MOGO_CORE_FUNCTION_AUTOPILOT_VERSION=0.0.58.10