Merge branch 'dev_minibus-d_230425_3.2.0' into merge320tomaster
@@ -1,5 +1,4 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.och.bus.passenger;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -69,14 +70,14 @@ public class MogoOCHBusPassenger implements IMogoOCH {
|
||||
* 进入鹰眼模式,设置手势缩放地图失效
|
||||
*/
|
||||
private void stepIntoVrMode() {
|
||||
CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "进入vr模式" );
|
||||
CallerLogger.INSTANCE.d( M_BUS_P + TAG, "进入vr模式" );
|
||||
CallerMoGoUiSettingManager.INSTANCE.stepInDayMode();//白天模式 状态栏字体颜色变黑
|
||||
}
|
||||
|
||||
private void showFragment() {
|
||||
FragmentManager supportFragmentManager = mActivity.getSupportFragmentManager();
|
||||
if(mPassengerFragment == null){
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "准备add fragment======");
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "准备add fragment======");
|
||||
Fragment fragmentByTag = supportFragmentManager.findFragmentByTag(BusPassengerRouteFragment.TAG);
|
||||
if (fragmentByTag instanceof BusPassengerRouteFragment){
|
||||
mPassengerFragment = (BusPassengerRouteFragment)fragmentByTag;
|
||||
@@ -89,7 +90,7 @@ public class MogoOCHBusPassenger implements IMogoOCH {
|
||||
return;
|
||||
}
|
||||
|
||||
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "准备show fragment");
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "准备show fragment");
|
||||
supportFragmentManager.beginTransaction().show(mPassengerFragment).commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package com.mogo.och.bus.passenger.adapter;
|
||||
|
||||
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_ARRIVING;
|
||||
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_LEAVING;
|
||||
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
@@ -19,10 +22,6 @@ import com.mogo.och.common.module.wigets.MarqueeTextView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_ARRIVING;
|
||||
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_LEAVING;
|
||||
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/4/6
|
||||
@@ -52,55 +51,69 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
viewHolder.stationName.setText(station.getName());
|
||||
BlinkAnimationUtil.clearAnimation(viewHolder.stationCircle);
|
||||
if (position == 0){ //第一个 起点
|
||||
viewHolder.stationTagTxt.setText("起");
|
||||
viewHolder.stationStationTag.setBackground(mContext.getDrawable(R.drawable.bg_bus_p_start_tag_bg));
|
||||
viewHolder.groupStationTagPanel.setVisibility(View.VISIBLE);
|
||||
viewHolder.curArrowBg.setVisibility(View.GONE);
|
||||
viewHolder.curArrowBottomBg.setVisibility(View.VISIBLE);
|
||||
Log.d("onBindViewHolder" , "position0 = "+position);
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bg_bus_p_start_tag_bg);
|
||||
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){//到达未离开
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_current_station_txt_color));
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_green);
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_clock_17417B));
|
||||
BlinkAnimationUtil.setAnimation(viewHolder.stationCircle);
|
||||
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
||||
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_1F82FB));
|
||||
}else {
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_gray);
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_clock_992D3E5F));
|
||||
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.END);
|
||||
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_A9B6CA));
|
||||
}
|
||||
}else{
|
||||
if (position == mStations.size() - 1){
|
||||
viewHolder.stationTagTxt.setText("终");
|
||||
viewHolder.stationStationTag.setBackground(mContext.getDrawable(R.drawable.bg_bus_p_end_tag_bg));
|
||||
viewHolder.groupStationTagPanel.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
viewHolder.groupStationTagPanel.setVisibility(View.GONE);
|
||||
}
|
||||
viewHolder.curArrowBg.setVisibility(View.VISIBLE);
|
||||
viewHolder.curArrowBottomBg.setVisibility(View.VISIBLE);
|
||||
BusPassengerStation preStation = mStations.get(position -1);
|
||||
if (station.getDrivingStatus() == STATION_STATUS_LEAVING ||
|
||||
(station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving())){ //过站
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
|
||||
viewHolder.curArrowBg.setImageResource(R.drawable.bus_p_line_grey);
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_clock_992D3E5F));
|
||||
viewHolder.curArrowBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_A9B6CA));
|
||||
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_A9B6CA));
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_gray);
|
||||
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.END);
|
||||
Log.d("onBindViewHolder" , "position 1 = "+position);
|
||||
} else if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){//刚到站未离开的
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_current_station_txt_color));
|
||||
viewHolder.curArrowBg.setImageResource(R.drawable.bus_p_line_grey);
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_green);
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_clock_17417B));
|
||||
viewHolder.curArrowBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_A9B6CA));
|
||||
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_1F82FB));
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_arrive_line_green);
|
||||
if (position == mStations.size() - 1){
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bg_bus_p_end_tag_bg);
|
||||
viewHolder.curArrowBottomBg.setVisibility(View.GONE);
|
||||
}
|
||||
Log.d("onBindViewHolder" , "position2 = "+position);
|
||||
BlinkAnimationUtil.setAnimation(viewHolder.stationCircle);
|
||||
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
||||
}else if (station.getDrivingStatus() == STATION_STATUS_ARRIVING && preStation.isLeaving()){//即将到站
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_current_station_txt_color));
|
||||
viewHolder.curArrowBg.setImageResource(R.drawable.bus_p_line_green);
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_green);
|
||||
BlinkAnimationUtil.setAnimation(viewHolder.stationCircle);
|
||||
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_panel_cur_station_tips_color));
|
||||
viewHolder.curArrowBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_A9B6CA));
|
||||
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_1F82FB));
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_arrive_line_blue);
|
||||
Log.d("onBindViewHolder" , "position3 = "+position);
|
||||
|
||||
if (position == mStations.size() - 1){
|
||||
viewHolder.curArrowBottomBg.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}else if (station.getDrivingStatus() == STATION_STATUS_ARRIVING &&
|
||||
(preStation.getDrivingStatus() == STATION_STATUS_ARRIVING
|
||||
|| preStation.getDrivingStatus() == STATION_STATUS_STOPPED)){ //未到站的并且前面也是未到站或者刚到站的
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_station_txt_color));
|
||||
viewHolder.curArrowBg.setImageResource(R.drawable.bus_p_line_blue);
|
||||
viewHolder.stationName.setTextColor(mContext.getResources().getColor(R.color.bus_p_panel_cur_station_tips_color));
|
||||
viewHolder.curArrowBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_1F82FB));
|
||||
viewHolder.curArrowBottomBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_1F82FB));
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_blue);
|
||||
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.END);
|
||||
|
||||
if (position == mStations.size() - 1){
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bg_bus_p_end_tag_bg);
|
||||
viewHolder.curArrowBottomBg.setVisibility(View.GONE);
|
||||
}
|
||||
Log.d("onBindViewHolder" , "position4 = "+position);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,21 +123,18 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
return mStations.size();
|
||||
}
|
||||
}
|
||||
|
||||
class StationViewHolder extends RecyclerView.ViewHolder{
|
||||
public MarqueeTextView stationName;
|
||||
public ImageView stationCircle;
|
||||
public ImageView curArrowBg;
|
||||
public ImageView stationStationTag;
|
||||
public TextView stationTagTxt;
|
||||
public Group groupStationTagPanel;
|
||||
public ImageView curArrowBottomBg;
|
||||
public StationViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
stationName = itemView.findViewById(R.id.bus_p_station);
|
||||
stationCircle = itemView.findViewById(R.id.bus_p_circle);
|
||||
curArrowBg = itemView.findViewById(R.id.bus_p_cur_arrow_bg);
|
||||
stationStationTag = itemView.findViewById(R.id.bus_p_tag);
|
||||
stationTagTxt = itemView.findViewById(R.id.bus_p_tag_txt);
|
||||
groupStationTagPanel = itemView.findViewById(R.id.group_station_tag_panel);
|
||||
curArrowBottomBg = itemView.findViewById(R.id.bus_p_cur_arrow_bottom_bg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,18 @@ public class BusPassengerRoutesResult {
|
||||
return runningDur;
|
||||
}
|
||||
|
||||
public String csvFileUrl = ""; //轨迹文件下载的cos url,默认“”
|
||||
public String csvFileMd5 = ""; //轨迹文件md5,默认“”
|
||||
public String txtFileUrl = ""; //打点文件下载的cos url,默认“”
|
||||
public String txtFileMd5 = ""; //轨迹文件md5,默认“”
|
||||
public long contrailSaveTime; //上传轨迹完成时间戳ms:用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
|
||||
public String carModel = ""; //[optional] 车型号(如红旗H9),默认“”,暂不加入校验逻辑、用于人工排查问题
|
||||
public String csvFileUrlDPQP = ""; //轨迹文件下载的cos url,默认“”
|
||||
public String csvFileMd5DPQP = ""; //轨迹文件md5,默认“”
|
||||
public String txtFileUrlDPQP = ""; //打点文件下载的cos url,默认“”
|
||||
public String txtFileMd5DPQP = ""; //轨迹文件md5,默认“”
|
||||
public long contrailSaveTimeDPQP; //上传轨迹完成时间戳ms:用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusPassengerRoutesResult{" +
|
||||
@@ -56,6 +68,18 @@ public class BusPassengerRoutesResult {
|
||||
", description='" + description + '\'' +
|
||||
", status=" + status +
|
||||
", runningDur='" + runningDur + '\'' +
|
||||
", taskTime=" + taskTime +
|
||||
", csvFileUrl='" + csvFileUrl + '\'' +
|
||||
", csvFileMd5='" + csvFileMd5 + '\'' +
|
||||
", txtFileUrl='" + txtFileUrl + '\'' +
|
||||
", txtFileMd5='" + txtFileMd5 + '\'' +
|
||||
", contrailSaveTime=" + contrailSaveTime +
|
||||
", carModel='" + carModel + '\'' +
|
||||
", csvFileUrlDPQP='" + csvFileUrlDPQP + '\'' +
|
||||
", csvFileMd5DPQP='" + csvFileMd5DPQP + '\'' +
|
||||
", txtFileUrlDPQP='" + txtFileUrlDPQP + '\'' +
|
||||
", txtFileMd5DPQP='" + txtFileMd5DPQP + '\'' +
|
||||
", contrailSaveTimeDPQP=" + contrailSaveTimeDPQP +
|
||||
'}';
|
||||
}
|
||||
|
||||
|
||||
@@ -7,4 +7,5 @@ package com.mogo.och.bus.passenger.callback;
|
||||
public interface IBusPassegerDriverStatusCallback {
|
||||
void changeOperationStatus(boolean changeStatus);
|
||||
void updatePlateNumber(String plateNumber);
|
||||
void updateDriverSn(String sn);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
@@ -28,6 +29,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||
@@ -58,12 +60,12 @@ import com.mogo.och.bus.passenger.network.BusPassengerServiceManager;
|
||||
import com.mogo.och.common.module.bean.dpmsg.AppConnectMsg;
|
||||
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg;
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPMsgType;
|
||||
import com.mogo.och.common.module.bean.dpmsg.LoginCacheStatus;
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager;
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
|
||||
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.common.module.utils.PinYinUtil;
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -107,7 +109,7 @@ public class BusPassengerModel {
|
||||
|
||||
List<BusPassengerStation> mStations = new ArrayList<>();
|
||||
private int mNextStationIndex = 0;// 要到达站的index
|
||||
private List<MogoLocation> mTwoStationsRouts = new ArrayList<>();
|
||||
private final List<MogoLocation> mTwoStationsRouts = new ArrayList<>();
|
||||
private int mPreRouteIndex = 0;
|
||||
private int mWipePreIndex = 0;
|
||||
|
||||
@@ -187,12 +189,16 @@ public class BusPassengerModel {
|
||||
if (routesResult != null) {
|
||||
routesResult = null;
|
||||
mNextStationIndex = 0;
|
||||
startOrStopCalculateRouteInfo(false);
|
||||
if (mRouteLineInfoCallback != null){
|
||||
mRouteLineInfoCallback.showNoTaskView();
|
||||
}
|
||||
}
|
||||
|
||||
startOrStopCalculateRouteInfo(false);
|
||||
|
||||
if (mRouteLineInfoCallback != null){
|
||||
mRouteLineInfoCallback.showNoTaskView();
|
||||
}
|
||||
|
||||
mRoutePoints.clear();
|
||||
|
||||
return;
|
||||
}
|
||||
if (routesResult != null && data.getResult().equals(routesResult)){
|
||||
@@ -233,21 +239,24 @@ public class BusPassengerModel {
|
||||
mStations.addAll(stations);
|
||||
for (int i = 0; i< stations.size(); i++){
|
||||
BusPassengerStation station = stations.get(i);
|
||||
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving() && i+1 < stations.size()){
|
||||
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving() && i+1 < stations.size()){ //离站
|
||||
mRouteLineInfoCallback.updateStationsInfo(stations,i+1,false);
|
||||
if(mNextStationIndex != i+1){
|
||||
mTwoStationsRouts.clear();
|
||||
startRemainRouteInfo();
|
||||
}
|
||||
mNextStationIndex = i+1;
|
||||
|
||||
updateAutopilotControlParameters(result,i);
|
||||
return;
|
||||
}else if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){
|
||||
}else if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){ //到站
|
||||
if (i == 0){
|
||||
startOrStopRouteAndWipe(false);
|
||||
}
|
||||
mPreRouteIndex = 0;
|
||||
startOrStopCalculateRouteInfo(false);
|
||||
mRouteLineInfoCallback.updateStationsInfo(stations,i,true);
|
||||
clearAutopilotControlParameters();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -256,6 +265,58 @@ public class BusPassengerModel {
|
||||
|
||||
}
|
||||
|
||||
private void updateAutopilotControlParameters(BusPassengerRoutesResult busRoutesResult,
|
||||
int leaveIndex) {
|
||||
|
||||
AutopilotControlParameters parameters = initAutopilotControlParameters(busRoutesResult,leaveIndex);
|
||||
if (null == parameters) {
|
||||
CallerLogger.INSTANCE.e(M_BUS_P + TAG, "AutopilotControlParameters is empty.");
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "AutopilotControlParameters is update.");
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(parameters);
|
||||
}
|
||||
|
||||
private void clearAutopilotControlParameters() {
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "AutopilotControlParameters is clear.");
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(null);
|
||||
}
|
||||
|
||||
private AutopilotControlParameters initAutopilotControlParameters(BusPassengerRoutesResult busRoutesResult,
|
||||
int leaveIndex) {
|
||||
if (busRoutesResult.getSites() == null){ return null ;}
|
||||
List<BusPassengerStation> stations = busRoutesResult.getSites();
|
||||
if (leaveIndex + 1 > stations.size() - 1) {
|
||||
CallerLogger.INSTANCE.e(M_BUS_P + TAG, "行程日志-mismatch condition1.");
|
||||
return null;
|
||||
}
|
||||
BusPassengerStation currentStation = stations.get(leaveIndex);
|
||||
BusPassengerStation nextStation = stations.get(leaveIndex + 1);
|
||||
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
parameters.routeID = busRoutesResult.getLineId();
|
||||
parameters.routeName = busRoutesResult.getName();
|
||||
parameters.startName = PinYinUtil.getPinYinHeadChar(currentStation.getName());
|
||||
parameters.endName = PinYinUtil.getPinYinHeadChar(nextStation.getName());
|
||||
parameters.startLatLon = new AutopilotControlParameters
|
||||
.AutoPilotLonLat(currentStation.getLat(), currentStation.getLon());
|
||||
parameters.endLatLon = new AutopilotControlParameters
|
||||
.AutoPilotLonLat(nextStation.getLat(), nextStation.getLon());
|
||||
parameters.vehicleType = 10;
|
||||
if (parameters.autoPilotLine == null) {
|
||||
parameters.autoPilotLine = new AutopilotControlParameters.AutoPilotLine(
|
||||
busRoutesResult.getLineId(),
|
||||
busRoutesResult.csvFileUrl, busRoutesResult.csvFileMd5,
|
||||
busRoutesResult.txtFileUrl, busRoutesResult.txtFileMd5,
|
||||
busRoutesResult.contrailSaveTime, busRoutesResult.carModel,
|
||||
busRoutesResult.csvFileUrlDPQP, busRoutesResult.csvFileMd5DPQP,
|
||||
busRoutesResult.txtFileUrlDPQP, busRoutesResult.txtFileMd5DPQP,
|
||||
busRoutesResult.contrailSaveTimeDPQP);
|
||||
}
|
||||
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public void release() {
|
||||
releaseListeners();
|
||||
startOrStopCalculateRouteInfo(false);
|
||||
@@ -318,6 +379,14 @@ public class BusPassengerModel {
|
||||
}
|
||||
|
||||
private final IReceivedMsgListener mReceivedMsgListener = new IReceivedMsgListener() {
|
||||
@Override
|
||||
public void onReceivedServerSn(@Nullable String sn) {
|
||||
Logger.d(SceneConstant.M_BUS_P+TAG,"onReceivedServerSn = "+sn);
|
||||
if (mDriverStatusCallback != null) {
|
||||
mDriverStatusCallback.updateDriverSn(sn);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedMsg(int type, @NonNull byte[] byteArray) {
|
||||
if (OchCommonConst.BUSINESS_STRING == type){
|
||||
@@ -397,22 +466,22 @@ public class BusPassengerModel {
|
||||
if (autopilotStatusInfo == null) return;
|
||||
int state = autopilotStatusInfo.getState();
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
//2022.7.20 自动驾驶更换成带档位的
|
||||
// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
if(state != mPreAutoStatus){
|
||||
mTwoStationsRouts.clear();
|
||||
}
|
||||
// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotEnable();
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotEnable();
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
if(state != mPreAutoStatus){
|
||||
mTwoStationsRouts.clear();
|
||||
}
|
||||
// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotDisable();
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotDisable();
|
||||
}else if (state == IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING){
|
||||
if(state != mPreAutoStatus){
|
||||
mTwoStationsRouts.clear();
|
||||
}
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
}
|
||||
mPreAutoStatus = state;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.mogo.och.bus.passenger.callback.IBusPassengerControllerStatusCallback
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerRouteLineInfoCallback;
|
||||
import com.mogo.och.bus.passenger.model.BusPassengerModel;
|
||||
import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -122,7 +123,12 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
|
||||
@Override
|
||||
public void updatePlateNumber(String plateNumber) {
|
||||
runOnUIThread(() -> mView.updatePlateNum(plateNumber));
|
||||
// runOnUIThread(() -> mView.updatePlateNum(plateNumber));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDriverSn(String sn) {
|
||||
runOnUIThread(() -> mView.updateDriverSn(sn));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,7 +137,7 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStationsInfo(List<BusPassengerStation> stations,int currentStationIndex,boolean isArrived) {
|
||||
public void updateStationsInfo(List<BusPassengerStation> stations, int currentStationIndex, boolean isArrived) {
|
||||
runOnUIThread(() -> mView.updateStationsInfo(stations,currentStationIndex, isArrived));
|
||||
}
|
||||
|
||||
@@ -159,6 +165,6 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
|
||||
@Override
|
||||
public void updateTotalDistance() {
|
||||
runOnUIThread(() -> mView.setProgressBarMax());
|
||||
// runOnUIThread(() -> mView.setProgressBarMax());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.mogo.och.bus.passenger.provider;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout;
|
||||
import com.mogo.och.bus.passenger.ui.BusPStatusBarView;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-06
|
||||
* <p>
|
||||
* 根据优先级控制显示 window view.
|
||||
*/
|
||||
@Route( path = MogoServicePaths.PATH_STATUS_VIEW_MANAGER )
|
||||
public class BusPStatusViewManager implements IStatusViewLayout {
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public View getStatusView(Context context) {
|
||||
return new BusPStatusBarView(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.BlueToothView
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import kotlinx.android.synthetic.jinlvvan.p_bus_view_blue_tooth.view.*
|
||||
|
||||
/**
|
||||
* 魔戒蓝牙控件
|
||||
* 放置于StatusBar右侧位置
|
||||
* todo arrow
|
||||
*/
|
||||
class BusPBlueToothView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : BlueToothView(context, attrs, defStyleAttr),IMoGoDevaToolsListener {
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.p_bus_view_blue_tooth, this, true)
|
||||
}
|
||||
|
||||
override fun mofangStatus(status: Boolean) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (status) {
|
||||
blueView.setImageResource(R.drawable.bus_p_blue_tooth_close)
|
||||
} else {
|
||||
blueView.setImageResource(R.drawable.bus_p_blue_tooth_open)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.annotation.*
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import chassis.ChassisStatesOuterClass
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoBatteryManagementSystemListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerBatteryManagementSystemListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import kotlinx.coroutines.*
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/2/14
|
||||
*/
|
||||
class BusPStatusBarView @JvmOverloads constructor(
|
||||
context: Context, attrs: AttributeSet? = null
|
||||
) : ConstraintLayout(context, attrs), IViewControlListener, IMoGoSkinModeChangeListener{
|
||||
|
||||
companion object {
|
||||
const val TAG = "BusPStatusBarView"
|
||||
}
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.p_bus_view_status_bar, this, true)
|
||||
setBackgroundResource(R.drawable.bg_status_bar)
|
||||
isClickable = true
|
||||
isFocusable = true
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
post {
|
||||
val params: ViewGroup.LayoutParams = getLayoutParams()
|
||||
params.height = AutoSizeUtils.dp2px(context,40f)
|
||||
layoutParams = params
|
||||
}
|
||||
//添加view控制
|
||||
CallerHmiViewControlListenerManager.addListener(TAG,this)
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
when (skinMode) {
|
||||
0 -> setStatusBarDarkOrLight(false)
|
||||
1 -> setStatusBarDarkOrLight(true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(TAG)
|
||||
CallerSkinModeListenerManager.removeListener(TAG)
|
||||
CallerDevaToolsManager.hideStatusBar()
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,22 @@
|
||||
package com.mogo.och.bus.passenger.ui;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.widget.ContentLoadingProgressBar;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.data.multidisplay.TelematicConstant;
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener;
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager;
|
||||
import com.mogo.eagle.core.function.view.MapBizView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
@@ -32,19 +27,9 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
|
||||
private static final String TAG = BusPassengerBaseFragment.class.getSimpleName();
|
||||
|
||||
private MapBizView mapBizView;
|
||||
private TextView mCurrentArriveStation;
|
||||
private TextView mCurrentArriveStationTitle;
|
||||
private TextView mCurrentArriveTip;
|
||||
private ImageView mAutopilotIv;
|
||||
private FrameLayout flContainer;
|
||||
private ContentLoadingProgressBar mProgressBar;
|
||||
|
||||
/**
|
||||
* 改变自动驾驶状态
|
||||
*
|
||||
* @param status 2 - running 1 - enable 2 - disable
|
||||
*/
|
||||
private int mPrevAPStatus = -1;
|
||||
protected AppCompatImageView videoSwitch;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -59,24 +44,51 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mapBizView = findViewById(R.id.mapBizView);
|
||||
mCurrentArriveStation = findViewById(R.id.bus_p_cur_station_name);
|
||||
mCurrentArriveStationTitle = findViewById(R.id.bus_p_cur_station_title);
|
||||
mCurrentArriveTip = findViewById(R.id.bus_p_cur_station_tip);
|
||||
mAutopilotIv = findViewById(R.id.bus_p_autopilot_iv);
|
||||
videoSwitch = findViewById(R.id.video_switch_iv);
|
||||
|
||||
mProgressBar = findViewById(R.id.bus_progress_bar);
|
||||
videoSwitch.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
openOrCloseLiveVideo();
|
||||
}
|
||||
});
|
||||
|
||||
CallerTelematicListenerManager.INSTANCE.addListener(TAG, new IReceivedMsgListener() {
|
||||
@Override
|
||||
public void onReceivedServerSn(@Nullable String sn) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedMsg(int type, @NonNull byte[] byteArray) {
|
||||
if (type == TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR) {
|
||||
switch (new String(byteArray)) {
|
||||
// 乘客端开启漫游
|
||||
case "0": {
|
||||
// mLiveShadow.setVisibility(View.GONE);
|
||||
goneLiveShadow();
|
||||
break;
|
||||
}
|
||||
// 乘客端关闭漫游
|
||||
case "1": {
|
||||
// mLiveShadow.setVisibility(View.VISIBLE);
|
||||
visibleLiveShadow();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
showRouteFragment();
|
||||
|
||||
// mCurrentArriveStation.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
// @Override
|
||||
// public boolean onLongClick(View v) {
|
||||
// showOverviewFragment();
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
protected abstract void openOrCloseLiveVideo();
|
||||
|
||||
protected abstract void goneLiveShadow();
|
||||
|
||||
protected abstract void visibleLiveShadow();
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState) {
|
||||
super.initViews(savedInstanceState);
|
||||
@@ -127,97 +139,4 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
|
||||
flContainer = findViewById(R.id.bus_p_route_panel);
|
||||
LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flContainer);
|
||||
}
|
||||
|
||||
public void updateArrivedStation(String station,int currentIndex,boolean isArrived){
|
||||
if (null == station){
|
||||
mCurrentArriveStation.setText("----");
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title_init));
|
||||
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
|
||||
removeProgressBar();
|
||||
}else {
|
||||
mCurrentArriveStation.setText(station);
|
||||
if (currentIndex == 0){
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title_init));
|
||||
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip_init));
|
||||
removeProgressBar();
|
||||
return;
|
||||
}
|
||||
if (isArrived){
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
|
||||
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
|
||||
removeProgressBar();
|
||||
}else {
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_next_station_title));
|
||||
mProgressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void removeProgressBar() {
|
||||
mProgressBar.setProgress(0);
|
||||
mProgressBar.setMax(0);
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void updateRoutePlanningToNextStation(long meters, long timeInSecond){
|
||||
//更新进度条
|
||||
updateProgressBar(meters);
|
||||
String dis = "0";
|
||||
String disUnit = "公里";
|
||||
if (meters > 0){
|
||||
if (meters / 1000 < 1){
|
||||
disUnit = "米";
|
||||
dis = String.valueOf(Math.round(meters));
|
||||
}else {
|
||||
disUnit = "公里";
|
||||
dis = NumberFormatUtil.formatLong((double)meters / 1000);
|
||||
}
|
||||
}
|
||||
String strHtml2 = "<font color=\"#2D3E5F\">距离 </font>" + "<b><font color=\"#0043FF\">" + dis + "</font></b>" + "<font color=\"#2D3E5F\"> "+disUnit+"</font>"
|
||||
+ "<font color=\"#2D3E5F\">   剩余 </font>" + "<b><font color=\"#0043FF\">" + (int)Math.ceil((double)timeInSecond/ 60f) + "</font></b>" + "<font color=\"#2D3E5F\"> 分钟</font>";
|
||||
mCurrentArriveTip.setText(Html.fromHtml(strHtml2));
|
||||
}
|
||||
|
||||
private void updateProgressBar(long meters) {
|
||||
int haveDriven = new Long(meters).intValue();
|
||||
int progressInt = SharedPrefsMgr.getInstance(getContext())
|
||||
.getInt(BusPassengerConst.BUS_SP_KEY_ORDER_SUM_DIS,0) - haveDriven;
|
||||
mProgressBar.setProgress(progressInt);
|
||||
}
|
||||
|
||||
public void setProgressBarMax(){
|
||||
int max = SharedPrefsMgr.getInstance(getContext())
|
||||
.getInt(BusPassengerConst.BUS_SP_KEY_ORDER_SUM_DIS,0);
|
||||
mProgressBar.setMax(max);
|
||||
}
|
||||
|
||||
public void onAutopilotStatusChanged(int status) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
// 3. 其他过程直接更新
|
||||
if (mPrevAPStatus != status){
|
||||
AutopilotStatusChanged(status);
|
||||
}
|
||||
mPrevAPStatus = status;
|
||||
});
|
||||
}
|
||||
|
||||
public void AutopilotStatusChanged(int status) {
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
|
||||
mAutopilotIv.setImageResource(R.drawable.bus_p_auto_nor);
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status){
|
||||
mAutopilotIv.setImageResource(R.drawable.bus_p_un_auto_nor);
|
||||
} else {
|
||||
mAutopilotIv.setImageResource(R.drawable.bus_p_un_auto_nor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void showOverviewFragment() {
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
}
|
||||
},5000L);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class BusPassengerMapDirectionView
|
||||
|
||||
private List<Marker> mLineMarkers = new ArrayList<>();
|
||||
|
||||
private IBusPassengerMapViewCallback mIBusPassengerMapViewCallback;
|
||||
// private IBusPassengerMapViewCallback mIBusPassengerMapViewCallback;
|
||||
private BitmapDescriptor mArrivedRes;
|
||||
private BitmapDescriptor mUnArrivedRes;
|
||||
|
||||
@@ -87,9 +87,9 @@ public class BusPassengerMapDirectionView
|
||||
}
|
||||
}
|
||||
|
||||
public void setTaxiPassengerMapViewCallback(IBusPassengerMapViewCallback iBusPassengerMapViewCallback) {
|
||||
this.mIBusPassengerMapViewCallback = iBusPassengerMapViewCallback;
|
||||
}
|
||||
// public void setTaxiPassengerMapViewCallback(IBusPassengerMapViewCallback iBusPassengerMapViewCallback) {
|
||||
// this.mIBusPassengerMapViewCallback = iBusPassengerMapViewCallback;
|
||||
// }
|
||||
|
||||
private void initView(Context context) {
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "initView");
|
||||
@@ -189,23 +189,29 @@ public class BusPassengerMapDirectionView
|
||||
mCarMarker.setToTop();
|
||||
}
|
||||
|
||||
//圈定地图显示范围
|
||||
LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder();
|
||||
try {
|
||||
|
||||
if (mCoordinatesLatLng.size() > 0){
|
||||
//存放经纬度
|
||||
for (int i = 0; i < mCoordinatesLatLng.size(); i++) {
|
||||
boundsBuilder.include(mCoordinatesLatLng.get(i));
|
||||
}
|
||||
//第二个参数为四周留空宽度
|
||||
}else if (mLineStationLatLng.size() > 0){
|
||||
for (int i = 0; i< mLineStationLatLng.size();i++){
|
||||
boundsBuilder.include(mLineStationLatLng.get(i));
|
||||
//圈定地图显示范围
|
||||
LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder();
|
||||
|
||||
if (mCoordinatesLatLng.size() > 0){
|
||||
//存放经纬度
|
||||
for (int i = 0; i < mCoordinatesLatLng.size(); i++) {
|
||||
boundsBuilder.include(mCoordinatesLatLng.get(i));
|
||||
}
|
||||
//第二个参数为四周留空宽度
|
||||
}else if (mLineStationLatLng.size() > 0){
|
||||
for (int i = 0; i< mLineStationLatLng.size();i++){
|
||||
boundsBuilder.include(mLineStationLatLng.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
boundsBuilder.include(currentLatLng);
|
||||
mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(),100,100,100,100));
|
||||
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
|
||||
boundsBuilder.include(currentLatLng);
|
||||
mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(),100,100,100,100));
|
||||
}
|
||||
|
||||
|
||||
@@ -336,7 +342,7 @@ public class BusPassengerMapDirectionView
|
||||
|
||||
@Override
|
||||
public void onCameraChange(CameraPosition cameraPosition) {
|
||||
mIBusPassengerMapViewCallback.onCameraChange(cameraPosition.bearing);
|
||||
// mIBusPassengerMapViewCallback.onCameraChange(cameraPosition.bearing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,33 +1,36 @@
|
||||
package com.mogo.och.bus.passenger.ui;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.RotateAnimation;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.utils.UiThreadHandler;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DriverMonitorView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.och.bus.passenger.R;
|
||||
import com.mogo.och.bus.passenger.adapter.BusPassengerLineStationsAdapter;
|
||||
import com.mogo.och.bus.passenger.bean.BusPassengerStation;
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerMapViewCallback;
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
|
||||
import com.mogo.och.bus.passenger.presenter.BaseBusPassengerPresenter;
|
||||
import com.mogo.och.bus.passenger.ui.layoutmanager.CenterLayoutManager;
|
||||
import com.mogo.och.bus.passenger.utils.BPRouteDataTestUtils;
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||
import com.mogo.och.common.module.wigets.MarqueeTextView;
|
||||
import com.mogo.och.common.module.wigets.OCHGradientTextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -37,26 +40,41 @@ import java.util.List;
|
||||
* @date: 2022/4/12
|
||||
*/
|
||||
public class BusPassengerRouteFragment extends
|
||||
BusPassengerBaseFragment<BusPassengerRouteFragment, BaseBusPassengerPresenter>
|
||||
implements IBusPassengerMapViewCallback {
|
||||
BusPassengerBaseFragment<BusPassengerRouteFragment, BaseBusPassengerPresenter> implements MapAndLiveVideoView.ChangeItemListener {
|
||||
|
||||
public static final String TAG = "BusPassengerRouteFragment";
|
||||
|
||||
private final List<BusPassengerStation> mStationsList = new ArrayList<>();
|
||||
|
||||
private TextView mSpeedTv;
|
||||
private OCHGradientTextView mSpeedTv;
|
||||
private ConstraintLayout mNoLineInfoView;
|
||||
private TextView mCarPlateNum;
|
||||
private MarqueeTextView mLineName;
|
||||
private TextView mOperationTime;
|
||||
private ConstraintLayout mRouteInfoView;
|
||||
private Group mRouteInfoView;
|
||||
private RecyclerView mStationsListRv;
|
||||
private BusPassengerMapDirectionView mMapDirectionView;
|
||||
private ImageView mMapArrowIcon;
|
||||
private RotateAnimation rotateAnimation;
|
||||
private float lastBearing = 0;
|
||||
private BusPassengerLineStationsAdapter mAdapter;
|
||||
private TextView emptyTv;
|
||||
private AppCompatImageView mAutopilotIv;
|
||||
private AppCompatTextView mCurrentArriveStation;
|
||||
private AppCompatTextView mCurrentArriveStationTitle;
|
||||
private AppCompatTextView mCurrentArriveTip;
|
||||
private AppCompatImageView mSpeakArrivedIv;
|
||||
|
||||
private View busPDriverMonitorView;
|
||||
private DriverMonitorView driverMonitorView;
|
||||
private ConstraintLayout indicatorView;
|
||||
private View mapIndicator;
|
||||
private View liveIndicator;
|
||||
|
||||
private MapAndLiveVideoView mapAndLiveVideoView;
|
||||
List<View> views = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 改变自动驾驶状态
|
||||
*
|
||||
* @param status 2 - running 1 - enable 2 - disable
|
||||
*/
|
||||
private int mPrevAPStatus = -1;
|
||||
|
||||
@Override
|
||||
public int getStationPanelViewId() {
|
||||
@@ -74,13 +92,19 @@ public class BusPassengerRouteFragment extends
|
||||
super.initViews();
|
||||
|
||||
mSpeedTv = findViewById(R.id.bus_p_speed_tv);
|
||||
mSpeedTv.setVertrial(true);
|
||||
mSpeedTv.setmColorList(new int[]{getResources().getColor(R.color.bus_p_speed_color_start),
|
||||
getResources().getColor(R.color.bus_p_speed_color_end)});
|
||||
|
||||
mNoLineInfoView =findViewById(R.id.bus_p_no_order_data_view);
|
||||
emptyTv = findViewById(R.id.no_order_data_tv);
|
||||
|
||||
mCarPlateNum = findViewById(R.id.bus_p_driver_num_plate_tv);
|
||||
mLineName = findViewById(R.id.bus_p_line_name_tv);
|
||||
mOperationTime = findViewById(R.id.line_operation_time_tv);
|
||||
mAutopilotIv = findViewById(R.id.auto_status_iv);
|
||||
mCurrentArriveStation = findViewById(R.id.bus_p_cur_station_name);
|
||||
mCurrentArriveStationTitle = findViewById(R.id.bus_p_cur_station_title);
|
||||
mCurrentArriveTip = findViewById(R.id.bus_p_cur_station_tip);
|
||||
mSpeakArrivedIv = findViewById(R.id.speak_arrived_iv);
|
||||
|
||||
mRouteInfoView = findViewById(R.id.bus_p_line_cl);
|
||||
mStationsListRv = findViewById(R.id.bus_p_line_stations_rl);
|
||||
@@ -90,7 +114,20 @@ public class BusPassengerRouteFragment extends
|
||||
mAdapter = new BusPassengerLineStationsAdapter(getContext(), mStationsList);
|
||||
mStationsListRv.setAdapter(mAdapter);
|
||||
|
||||
mMapArrowIcon = findViewById(R.id.bus_p_arrow_nor);
|
||||
indicatorView = findViewById(R.id.busIndicatorView);
|
||||
mapIndicator = findViewById(R.id.firstIndicator);
|
||||
liveIndicator = findViewById(R.id.secondIndicator);
|
||||
|
||||
busPDriverMonitorView = LayoutInflater.from(getContext())
|
||||
.inflate(R.layout.bus_p_driver_monitor_view,null);
|
||||
|
||||
driverMonitorView = busPDriverMonitorView.findViewById(R.id.buDriverMonitorView);
|
||||
driverMonitorView.setLiveListener(new DriverMonitorView.LiveListener() {
|
||||
@Override
|
||||
public void onPlayError() {
|
||||
goneLiveShadow();
|
||||
}
|
||||
});
|
||||
|
||||
//测试
|
||||
if (DebugConfig.isDebug()){
|
||||
@@ -102,14 +139,81 @@ public class BusPassengerRouteFragment extends
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
mapAndLiveVideoView = findViewById(R.id.mapAndLiveVideoView);
|
||||
|
||||
initLiveView();
|
||||
}
|
||||
|
||||
private void initLiveView() {
|
||||
views.add(new View(getContext()));// 其实是空的,真正小地图还在fragment里
|
||||
views.add(busPDriverMonitorView);
|
||||
mapAndLiveVideoView.setData(views);
|
||||
mapAndLiveVideoView.setVisibility(View.GONE);
|
||||
indicatorView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
@Override
|
||||
public void changeToItem(int position) {
|
||||
// (position == 0): 空view 地图占位 (position == 1) :live video
|
||||
if (position == 0){
|
||||
mapIndicator.setBackground(getContext().getDrawable(R.drawable.indicator_selected_bg));
|
||||
liveIndicator.setBackground(getContext().getDrawable(R.drawable.indicator_unselected_bg));
|
||||
}else {
|
||||
mapIndicator.setBackground(getContext().getDrawable(R.drawable.indicator_unselected_bg));
|
||||
liveIndicator.setBackground(getContext().getDrawable(R.drawable.indicator_selected_bg));
|
||||
}
|
||||
mMapDirectionView.setVisibility(position == 0? View.VISIBLE:View.GONE);
|
||||
}
|
||||
|
||||
public void updateDriverSn(String sn) {
|
||||
// TODO 这是测试方法,直播源为公司,凤坤旁的F车机
|
||||
//if (driverMonitorView.isSOPDriverSn("F803EB2046PZD00164")){
|
||||
if (driverMonitorView.isSOPDriverSn(sn)){
|
||||
visibleLiveShadow();
|
||||
}else {
|
||||
goneLiveShadow();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void openOrCloseLiveVideo() {
|
||||
if (videoSwitch.isSelected()){
|
||||
driverMonitorView.stopLive();
|
||||
videoSwitch.setSelected(false);
|
||||
}else {
|
||||
driverMonitorView.startLive();
|
||||
videoSwitch.setSelected(true);
|
||||
mapAndLiveVideoView.changeToSecondView();
|
||||
}
|
||||
mapAndLiveVideoView.setItemChangeListener(videoSwitch.isSelected()? this:null);
|
||||
mapAndLiveVideoView.setVisibility(videoSwitch.isSelected()? View.VISIBLE : View.GONE);
|
||||
indicatorView.setVisibility(videoSwitch.isSelected() ? View.VISIBLE : View.GONE);
|
||||
mMapDirectionView.setVisibility(videoSwitch.isSelected() ? View.GONE : View.VISIBLE);
|
||||
mapIndicator.setBackground(getContext().getDrawable(R.drawable.indicator_unselected_bg));
|
||||
liveIndicator.setBackground(getContext().getDrawable(R.drawable.indicator_selected_bg));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void goneLiveShadow() {
|
||||
videoSwitch.setVisibility(View.GONE);
|
||||
// driverMonitorView.setVisibility(View.GONE);
|
||||
indicatorView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void visibleLiveShadow() {
|
||||
videoSwitch.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState) {
|
||||
super.initViews(savedInstanceState);
|
||||
mMapDirectionView = findViewById(R.id.bus_p_line_map_view);
|
||||
mMapDirectionView = findViewById(R.id.busPLineMapView);
|
||||
mMapDirectionView.onCreateView(savedInstanceState);
|
||||
mMapDirectionView.setTaxiPassengerMapViewCallback(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,6 +297,7 @@ public class BusPassengerRouteFragment extends
|
||||
emptyTv.setText(getString(R.string.bus_p_no_out));
|
||||
mNoLineInfoView.setVisibility(View.VISIBLE);
|
||||
mRouteInfoView.setVisibility(View.GONE);
|
||||
mLineName.setText(getContext().getString(R.string.bus_p_no_line));
|
||||
updateArrivedStation(null,0,true);
|
||||
clearMapView();
|
||||
clearMapMarkers();
|
||||
@@ -203,6 +308,7 @@ public class BusPassengerRouteFragment extends
|
||||
if (mNoLineInfoView.getVisibility() == View.GONE){
|
||||
mNoLineInfoView.setVisibility(View.VISIBLE);
|
||||
mRouteInfoView.setVisibility(View.GONE);
|
||||
mLineName.setText(getContext().getString(R.string.bus_p_no_line));
|
||||
updateArrivedStation(null,0,true);
|
||||
clearMapView();
|
||||
clearMapMarkers();
|
||||
@@ -217,17 +323,9 @@ public class BusPassengerRouteFragment extends
|
||||
}
|
||||
}
|
||||
|
||||
public void updatePlateNum(String plateNum){
|
||||
if ("".equals(plateNum) || null == plateNum) {
|
||||
mCarPlateNum.setText("-- --");
|
||||
}else {
|
||||
mCarPlateNum.setText((plateNum));
|
||||
}
|
||||
}
|
||||
|
||||
public void updateLineInfo(String lineName, String lineDurTime) {
|
||||
mLineName.setText(lineName);
|
||||
mOperationTime.setText(lineDurTime);
|
||||
// mOperationTime.setText(lineDurTime);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -236,7 +334,7 @@ public class BusPassengerRouteFragment extends
|
||||
* @param currentStationIndex
|
||||
* @param isArrived 是否到站并离开,true 到达当前站 currentStationIndex 未离开, false 正在前往此站 currentStationIndex
|
||||
*/
|
||||
public void updateStationsInfo(List<BusPassengerStation> stations, int currentStationIndex,boolean isArrived) {
|
||||
public void updateStationsInfo(List<BusPassengerStation> stations, int currentStationIndex, boolean isArrived) {
|
||||
updateArrivedStation(stations.get(currentStationIndex).getName(),currentStationIndex,isArrived);
|
||||
mStationsList.clear();
|
||||
mStationsList.addAll(stations);
|
||||
@@ -260,8 +358,6 @@ public class BusPassengerRouteFragment extends
|
||||
private void updateWayPointList(List<BusPassengerStation> stations,int currentStationIndex) {
|
||||
List<LatLng> mLineStationsList = new ArrayList<>();
|
||||
for (int i = 0; i< stations.size(); i++) {//站点集合
|
||||
// LatLng latLng = CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(getContext()
|
||||
// ,stations.get(i).getLon(),stations.get(i).getLat());// lat,lon
|
||||
LatLng latLng = new LatLng(stations.get(i).getGcjLat(),stations.get(i).getGcjLon());// lat,lon
|
||||
mLineStationsList.add(latLng);
|
||||
}
|
||||
@@ -276,27 +372,6 @@ public class BusPassengerRouteFragment extends
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraChange(float bearing) {
|
||||
startIvCompass(bearing);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置指南针旋转
|
||||
*
|
||||
* @param bearing
|
||||
*/
|
||||
private void startIvCompass(float bearing) {
|
||||
bearing = 360 - bearing;
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "startIvCompass: " + bearing);
|
||||
rotateAnimation = new RotateAnimation(lastBearing, bearing, Animation.RELATIVE_TO_SELF
|
||||
, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
|
||||
rotateAnimation.setFillAfter(true);
|
||||
|
||||
mMapArrowIcon.startAnimation(rotateAnimation);
|
||||
lastBearing = bearing;
|
||||
}
|
||||
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
updateSpeedView((float) location.getGnssSpeed());
|
||||
}
|
||||
@@ -311,4 +386,85 @@ public class BusPassengerRouteFragment extends
|
||||
mStationsListRv.smoothScrollToPosition(position);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateArrivedStation(String station,int currentIndex,boolean isArrived){
|
||||
if (null == station){
|
||||
mCurrentArriveStation.setText("----");
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
|
||||
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
|
||||
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg);
|
||||
handleArrivingSpeakIconDrawable();
|
||||
}else {
|
||||
mCurrentArriveStation.setText(station);
|
||||
if (currentIndex == 0){
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
|
||||
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
|
||||
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg);
|
||||
handleArrivingSpeakIconDrawable();
|
||||
return;
|
||||
}
|
||||
if (isArrived){
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
|
||||
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
|
||||
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg);
|
||||
handleArrivedSpeakIconDrawable();
|
||||
}else {
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_next_station_title));
|
||||
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_un_arrived_bg);
|
||||
handleArrivingSpeakIconDrawable();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void handleArrivedSpeakIconDrawable(){
|
||||
AnimationDrawable animationDrawable = (AnimationDrawable) mSpeakArrivedIv.getDrawable();
|
||||
animationDrawable.start();
|
||||
mSpeakArrivedIv.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
private void handleArrivingSpeakIconDrawable(){
|
||||
AnimationDrawable animationDrawable = (AnimationDrawable) mSpeakArrivedIv.getDrawable();
|
||||
animationDrawable.stop();
|
||||
mSpeakArrivedIv.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void updateRoutePlanningToNextStation(long meters, long timeInSecond){
|
||||
//更新进度条
|
||||
String dis = "0";
|
||||
String disUnit = "公里";
|
||||
if (meters > 0){
|
||||
if (meters / 1000 < 1){
|
||||
disUnit = "米";
|
||||
dis = String.valueOf(Math.round(meters));
|
||||
}else {
|
||||
disUnit = "公里";
|
||||
dis = NumberFormatUtil.formatLong((double)meters / 1000);
|
||||
}
|
||||
}
|
||||
// String strHtml2 = "<font color=\"#2D3E5F\">距离 </font>" + "<b><font color=\"#0043FF\">" + dis + "</font></b>" + "<font color=\"#2D3E5F\"> "+disUnit+"</font>"
|
||||
// + "<font color=\"#2D3E5F\">   剩余 </font>" + "<b><font color=\"#0043FF\">" + (int)Math.ceil((double)timeInSecond/ 60f) + "</font></b>" + "<font color=\"#2D3E5F\"> 分钟</font>";
|
||||
String str = dis+disUnit+" | "+(int)Math.ceil((double)timeInSecond/ 60f)+"分钟";
|
||||
mCurrentArriveTip.setText(str);
|
||||
}
|
||||
|
||||
public void onAutopilotStatusChanged(int status) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
// 3. 其他过程直接更新
|
||||
if (mPrevAPStatus != status){
|
||||
AutopilotStatusChanged(status);
|
||||
}
|
||||
mPrevAPStatus = status;
|
||||
});
|
||||
}
|
||||
|
||||
public void AutopilotStatusChanged(int status) {
|
||||
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
|
||||
mAutopilotIv.setImageResource(R.drawable.auto_open);
|
||||
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status){
|
||||
mAutopilotIv.setImageResource(R.drawable.auto_close);
|
||||
} else {
|
||||
mAutopilotIv.setImageResource(R.drawable.auto_close);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.RelativeLayout
|
||||
import androidx.viewpager.widget.PagerAdapter
|
||||
import androidx.viewpager.widget.ViewPager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.ui.MapAndLiveVideoView.Companion.TAG
|
||||
import java.lang.Exception
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/5/9
|
||||
*/
|
||||
|
||||
class MapAndLiveVideoView @JvmOverloads constructor(
|
||||
context: Context, attrs: AttributeSet? = null
|
||||
) : RelativeLayout(context, attrs), ViewPager.OnPageChangeListener {
|
||||
|
||||
private var viewPager: ViewPager? = null
|
||||
private var pagerAdapter: AdvancePagerAdapter? = null
|
||||
private var changeItemListener: ChangeItemListener? = null
|
||||
|
||||
companion object {
|
||||
const val TAG = "MapAndLiveVideoView"
|
||||
}
|
||||
|
||||
init {
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
viewPager = ViewPager(context)
|
||||
pagerAdapter = AdvancePagerAdapter()
|
||||
viewPager?.adapter = pagerAdapter
|
||||
|
||||
addView(viewPager, LayoutParams(-1, -1))
|
||||
|
||||
viewPager?.addOnPageChangeListener(this)
|
||||
}
|
||||
|
||||
fun setData(list: MutableList<View>){
|
||||
pagerAdapter?.setData(list)
|
||||
pagerAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
fun setItemChangeListener(listener : ChangeItemListener?){
|
||||
changeItemListener = listener
|
||||
}
|
||||
|
||||
fun changeToSecondView(){
|
||||
if (viewPager?.currentItem == 0){
|
||||
startPosition = 0
|
||||
}
|
||||
viewPager?.currentItem = 1
|
||||
}
|
||||
|
||||
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
|
||||
Logger.d(TAG, "onPageScrolled--position = $position")
|
||||
}
|
||||
|
||||
override fun onPageSelected(position: Int) {
|
||||
Logger.d(TAG, "onPageSelected--position = $position")
|
||||
}
|
||||
var startPosition = 1
|
||||
override fun onPageScrollStateChanged(state: Int) {
|
||||
Logger.d(TAG, "onPageScrollStateChanged--state = $state")
|
||||
viewPager?.let {
|
||||
val position = it.currentItem
|
||||
if (state == 0) { //静止
|
||||
if (startPosition == position){
|
||||
if (position==0){
|
||||
it.currentItem = 1
|
||||
}else{
|
||||
it.currentItem = 0
|
||||
}
|
||||
}else{
|
||||
changeItemListener?.changeToItem(it.currentItem)
|
||||
}
|
||||
}else if (state == 1){ // 开始滑动
|
||||
startPosition = it.currentItem
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface ChangeItemListener{
|
||||
fun changeToItem(position: Int)
|
||||
}
|
||||
}
|
||||
|
||||
class AdvancePagerAdapter : PagerAdapter(),
|
||||
ViewPager.OnPageChangeListener {
|
||||
private var views: List<View>? = null
|
||||
|
||||
fun setData(views: List<View>?){
|
||||
this.views = views
|
||||
}
|
||||
|
||||
override fun instantiateItem(container: View, position: Int): Any {
|
||||
Logger.d(TAG, "instantiateItem--position = $position")
|
||||
return try {
|
||||
val currentItem = position % views!!.size
|
||||
(container as ViewPager).addView(views!![currentItem])
|
||||
views!![currentItem]
|
||||
}catch (e: Exception){
|
||||
container
|
||||
}
|
||||
}
|
||||
|
||||
override fun getCount(): Int {
|
||||
return if (views == null){
|
||||
0
|
||||
}else{
|
||||
views!!.size
|
||||
}
|
||||
}
|
||||
|
||||
override fun isViewFromObject(arg0: View, arg1: Any): Boolean {
|
||||
return arg0 === arg1
|
||||
}
|
||||
|
||||
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
|
||||
// Logger.d(TAG, "onPageScrolled--position = $position")
|
||||
}
|
||||
|
||||
override fun onPageSelected(position: Int) {
|
||||
// Logger.d(TAG, "onPageSelected--position = $position")
|
||||
}
|
||||
|
||||
override fun onPageScrollStateChanged(state: Int) {
|
||||
// Logger.d(TAG, "onPageScrollStateChanged--state = $state")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.mogo.och.bus.passenger.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/2/13
|
||||
*/
|
||||
class BusPTurnLightView @JvmOverloads constructor(
|
||||
context: Context, attrs: AttributeSet? = null
|
||||
) : TurnLightViewStatus(context, attrs) {
|
||||
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 900 B |
|
After Width: | Height: | Size: 838 B |
|
Before Width: | Height: | Size: 765 B After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 879 B After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 354 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 844 B |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 855 B |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 287 KiB |
|
After Width: | Height: | Size: 838 B |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 200 B |
|
After Width: | Height: | Size: 821 B |
|
After Width: | Height: | Size: 1.6 KiB |
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="@dimen/bus_p_station_tag_width_height"
|
||||
android:height="@dimen/bus_p_station_tag_width_height">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/bus_p_station_tag_radius_size"/>
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="@color/bus_p_end_tag_bg_color1"
|
||||
android:startColor="@color/bus_p_end_tag_bg_color2"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="@dimen/bus_p_station_tag_width_height"
|
||||
android:height="@dimen/bus_p_station_tag_width_height">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/bus_p_station_tag_radius_size"/>
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="@color/bus_p_start_tag_bg_color1"
|
||||
android:startColor="@color/bus_p_start_tag_bg_color2"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:visible="true"
|
||||
android:oneshot="false">
|
||||
<item android:drawable="@drawable/speak_arrived_icon_0" android:duration="300"/>
|
||||
<item android:drawable="@drawable/speak_arrived_icon_1" android:duration="300"/>
|
||||
<item android:drawable="@drawable/speak_arrived_icon_2" android:duration="300"/>
|
||||
</animation-list>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient android:startColor="#FFFFFF"
|
||||
android:centerColor="#00FFFFFF"
|
||||
android:endColor="#00FFFFFF"
|
||||
android:angle="0"
|
||||
/>
|
||||
</shape>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#CDDBF6" />
|
||||
<corners android:bottomLeftRadius="@dimen/dp_20"
|
||||
android:bottomRightRadius="@dimen/dp_20"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#C9E0F4" />
|
||||
<corners android:radius="@dimen/dp_30" />
|
||||
</shape>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="#F2F6FF"
|
||||
android:startColor="#E1E7F5"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_18"/>
|
||||
<solid android:color="@color/bus_p_m1_CCFFFFFF"/>
|
||||
|
||||
<solid android:color="#1466FB"/>
|
||||
<corners android:radius="2dp"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#A9B6CA"/>
|
||||
<corners android:radius="2dp"/>
|
||||
</shape>
|
||||
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" tools:ignore="MissingDefaultResource">
|
||||
<item android:drawable="@drawable/iv_roma_bus_passenger_press_bg" android:state_focused="true" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/iv_roma_bus_passenger_press_bg" android:state_focused="false" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/iv_roma_bus_passenger_press_bg" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/iv_roma_bus_passenger_press_bg" android:state_focused="true" />
|
||||
<item android:drawable="@drawable/iv_roma_bus_passenger_bg" />
|
||||
</selector>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/icon_video_open" android:state_focused="true" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/icon_video_open" android:state_focused="false" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/icon_video_open" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/icon_video_open" android:state_focused="true" />
|
||||
<item android:drawable="@drawable/icon_video_close" />
|
||||
</selector>
|
||||
@@ -6,12 +6,18 @@
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
android:layout_width="@dimen/dp_1860"
|
||||
android:layout_width="1810dp"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.BusPStatusBarView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
|
||||
android:layout_width="@dimen/dp_400"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
@@ -20,32 +26,17 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
|
||||
android:id="@+id/steering_wheel"
|
||||
android:layout_width="@dimen/dp_490"
|
||||
android:layout_height="@dimen/dp_490"
|
||||
android:layout_marginLeft="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_88"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_autopilot_iv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/bus_p_curent_station_panel_margin"
|
||||
android:layout_marginTop="@dimen/dp_112"
|
||||
android:scaleType="fitXY"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:src="@drawable/bus_p_un_auto_nor"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!--浓雾预警动画-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XFogEventView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaPassengerView
|
||||
android:id="@+id/ivMoGoLogo"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:background="@drawable/roma_bus_p_bg_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:layout_marginLeft="10dp"
|
||||
app:layout_constraintLeft_toRightOf="@+id/video_switch_iv"
|
||||
app:roma_close="@drawable/roma_bus_p_bg_selector"
|
||||
app:roma_open="@drawable/iv_roma_bus_passenger_press_bg" />
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
@@ -56,94 +47,15 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/arrive_station_shadow"
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/bus_p_traffic_light_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/bus_p_curent_station_panel_margin_left"
|
||||
android:layout_marginBottom="@dimen/bus_p_curent_station_panel_margin"
|
||||
app:bgColor="@android:color/transparent"
|
||||
app:blurRadius="@dimen/dp_30"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginLeft="@dimen/dp_722"
|
||||
android:layout_marginTop="@dimen/dp_112"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:shadowColor="@color/bus_p_panel_edge_shadow"
|
||||
app:shadowRadius="@dimen/dp_30"
|
||||
app:xOffset="0dp"
|
||||
app:yOffset="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/bus_p_curent_station_panel_width"
|
||||
android:layout_height="@dimen/bus_p_curent_station_panel_height"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/bus_p_panel_cur_station_panel">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_cur_station_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_56"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:text="@string/bus_p_cur_station_title"
|
||||
android:textColor="@color/bus_p_panel_cur_txt_color"
|
||||
android:textSize="@dimen/bus_p_curent_station_txt_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_cur_station_name"
|
||||
android:layout_width="@dimen/bus_p_curent_station_txt_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="-- --"
|
||||
android:textColor="@color/bus_p_panel_cur_station_txt_color"
|
||||
android:textSize="@dimen/bus_p_curent_station_txt_size1"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_cur_station_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_title" />
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_27"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_cur_station_name"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_cur_station_name"
|
||||
app:layout_constraintRight_toLeftOf="@+id/bus_p_cur_station_name"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
android:src="@drawable/station_arrow">
|
||||
|
||||
</androidx.appcompat.widget.AppCompatImageView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_cur_station_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:text="@string/bus_p_cur_station_arrived_tip"
|
||||
android:textColor="@color/bus_p_panel_cur_station_tips_color"
|
||||
android:textSize="@dimen/bus_p_curent_station_tip_size1"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_cur_station_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_name" />
|
||||
|
||||
<androidx.core.widget.ContentLoadingProgressBar
|
||||
android:id="@+id/bus_progress_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:progress="0"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:progressDrawable="@drawable/bus_progress_bar_bg" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/bus_p_route_panel"
|
||||
@@ -152,15 +64,6 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_299"
|
||||
android:layout_height="@dimen/dp_75"
|
||||
android:layout_marginRight="@dimen/dp_40"
|
||||
android:layout_marginBottom="@dimen/dp_48"
|
||||
android:src="@drawable/bus_p_mogo_nor"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/bus_p_route_panel" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.BusPassengerMsgBoxBubbleView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -170,4 +73,17 @@
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/video_switch_iv"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:src="@drawable/video_btn_selector"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_20"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/bus_p_route_info_panel_width"
|
||||
android:layout_height="@dimen/bus_p_route_line_map_view_height"
|
||||
android:background="@drawable/live_view_loading_bg">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.DriverMonitorView
|
||||
android:id="@+id/buDriverMonitorView"
|
||||
android:layout_width="@dimen/bus_p_route_info_panel_width"
|
||||
android:layout_height="@dimen/bus_p_route_line_map_view_height"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -2,7 +2,8 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bottom_radius_bg">
|
||||
<com.amap.api.maps.TextureMapView
|
||||
android:id="@+id/bus_p_line_amap_view"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -5,24 +5,31 @@
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/bus_p_no_order_data_view">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/no_order_data_iv"
|
||||
android:layout_width="@dimen/dp_386"
|
||||
android:layout_height="@dimen/dp_350"
|
||||
android:src="@drawable/bus_p_no_order_data"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"/>
|
||||
<TextView
|
||||
android:id="@+id/no_order_data_tv"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/bus_p_no_data_color"
|
||||
android:textSize="@dimen/bus_p_no_data_size"
|
||||
android:layout_marginTop="50dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/no_order_data_iv"
|
||||
android:text="@string/bus_p_no_out"/>
|
||||
app:layout_constraintRight_toRightOf="parent">
|
||||
<ImageView
|
||||
android:id="@+id/no_order_data_iv"
|
||||
android:layout_width="@dimen/dp_200"
|
||||
android:layout_height="@dimen/dp_210"
|
||||
android:src="@drawable/bus_p_no_order_data"
|
||||
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="@color/bus_p_speed_txt_color"
|
||||
android:textSize="@dimen/bus_p_no_data_size"
|
||||
android:layout_marginTop="50dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/no_order_data_iv"
|
||||
android:text="@string/bus_p_no_out"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,182 +1,322 @@
|
||||
<?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_width="@dimen/bus_p_route_bg_width"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent">
|
||||
android:background="@drawable/bus_p_right_route_bg">
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/edge_view"
|
||||
android:layout_width="725dp"
|
||||
android:layout_width="800dp"
|
||||
android:layout_height="match_parent"
|
||||
app:shadowColor="@color/bus_p_route_view_left_edge_shadow"
|
||||
app:xOffset="0dp"
|
||||
app:yOffset="0dp"
|
||||
app:bgColor="@android:color/transparent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/bus_p_route_info_panel_width"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent" />
|
||||
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
app:bgColor="#00000000"
|
||||
app:blurRadius="@dimen/dp_28"
|
||||
app:shadowColor="#45688AE1"
|
||||
app:shadowRadius="@dimen/dp_40"
|
||||
app:shadow_position="outer"
|
||||
app:xOffset="0dp"
|
||||
app:yOffset="0dp"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<com.mogo.och.common.module.wigets.OCHRoundConstraintLayout
|
||||
android:layout_width="@dimen/bus_p_route_info_panel_width"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bus_p_route_bg"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_marginRight="@dimen/dp_40"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:roundLayoutRadius="@dimen/dp_40">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_speed_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/bus_p_route_info_margin_left"
|
||||
android:layout_marginTop="@dimen/bus_p_route_info_margin_top"
|
||||
android:includeFontPadding="false"
|
||||
android:letterSpacing="-0.05"
|
||||
android:text="0"
|
||||
android:textColor="@color/bus_p_speed_txt_color"
|
||||
android:textSize="@dimen/bus_p_speed_txt_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="@dimen/bus_p_route_info_panel_width"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/bus_p_route_bg"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_unit_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginRight="@dimen/bus_p_route_info_margin_right"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:includeFontPadding="false"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/bus_p_speed_unit_txt"
|
||||
android:textColor="@color/bus_p_speed_txt_color"
|
||||
android:textSize="@dimen/bus_p_speed_unit_txt_size"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_speed_tv"
|
||||
app:layout_constraintLeft_toRightOf="@+id/bus_p_speed_tv" />
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.BusPassengerTrafficLightView
|
||||
android:id="@+id/bus_p_traffic_light_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/bus_p_route_info_margin_right"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_unit_tv"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/dividing_line_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bus_p_route_line_dividing_view_height"
|
||||
android:background="@drawable/bus_p_dividing_line_bg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_speed_tv" />
|
||||
|
||||
<include
|
||||
layout="@layout/bus_p_no_data_common_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bus_p_line_map_view"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dividing_line_1" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/bus_p_line_cl"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/driver_info_bg"
|
||||
android:layout_width="@dimen/bus_p_route_info_panel_width"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bus_p_line_map_view"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dividing_line_1">
|
||||
app:layout_constraintBottom_toTopOf="@+id/busPLineMapView"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_driver_num_plate_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/bus_p_route_info_margin_left"
|
||||
android:layout_marginTop="@dimen/bus_p_driver_number_plate_margin_top"
|
||||
android:text="----"
|
||||
android:textColor="@color/bus_p_driver_number_plate_color"
|
||||
android:textSize="@dimen/bus_p_driver_number_plate_size"
|
||||
android:textStyle="bold"
|
||||
<View
|
||||
android:layout_width="@dimen/dp_698"
|
||||
android:layout_height="@dimen/dp_76"
|
||||
android:background="@drawable/route_line_name_bg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.MarqueeTextView
|
||||
android:id="@+id/bus_p_line_name_tv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:singleLine="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_76"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:text="----"
|
||||
app:customGap="0.5"
|
||||
app:useCustomGap="true"
|
||||
android:maxWidth="@dimen/dp_340"
|
||||
android:singleLine="true"
|
||||
android:text="@string/bus_p_no_line"
|
||||
android:textColor="@color/bus_p_line_name_color"
|
||||
android:textSize="@dimen/bus_p_driver_number_plate_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@+id/bus_p_driver_num_plate_tv"
|
||||
app:customGap="0.5"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_driver_num_plate_tv"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_driver_num_plate_tv"
|
||||
app:layout_goneMarginLeft="0dp" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_goneMarginLeft="0dp"
|
||||
app:useCustomGap="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/line_operation_time_tv"
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/bus_p_line_operation_time_margin_top"
|
||||
android:text="-- --"
|
||||
android:textColor="@color/bus_p_line_operation_time_color"
|
||||
android:textSize="@dimen/bus_p_line_operation_time_size"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:src="@drawable/bus_line_logo"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_line_name_tv"
|
||||
app:layout_constraintRight_toLeftOf="@+id/bus_p_line_name_tv"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_line_name_tv" />
|
||||
|
||||
<View
|
||||
android:id="@+id/dividing_line_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bus_p_route_line_dividing_view_height"
|
||||
android:layout_marginTop="@dimen/bus_p_route_dividing_line2_margin_top"
|
||||
android:background="@drawable/bus_p_dividing_line_bg"
|
||||
<com.mogo.och.common.module.wigets.OCHGradientTextView
|
||||
android:id="@+id/bus_p_speed_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/bus_p_route_info_margin_left"
|
||||
android:layout_marginTop="@dimen/dp_90"
|
||||
android:includeFontPadding="false"
|
||||
android:letterSpacing="-0.05"
|
||||
android:text="0"
|
||||
android:textSize="@dimen/bus_p_speed_txt_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_p_unit_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginRight="@dimen/bus_p_route_info_margin_right"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@string/bus_p_speed_unit_txt"
|
||||
android:textColor="@color/bus_p_speed_txt_color"
|
||||
android:textSize="@dimen/bus_p_speed_unit_txt_size"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_speed_tv"
|
||||
app:layout_constraintLeft_toRightOf="@+id/bus_p_speed_tv" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/auto_status_iv"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_58"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:src="@drawable/auto_close"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_speed_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_speed_tv" />
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.widget.BusPTurnLightView
|
||||
android:layout_width="@dimen/dp_104"
|
||||
android:layout_height="@dimen/dp_58"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
app:day_light_mode="true"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/auto_status_iv"
|
||||
app:layout_constraintLeft_toRightOf="@+id/auto_status_iv"
|
||||
app:layout_constraintTop_toTopOf="@+id/auto_status_iv"
|
||||
app:visible="false" />
|
||||
|
||||
<View
|
||||
android:id="@+id/dividing_line_1"
|
||||
android:layout_width="@dimen/dp_1"
|
||||
android:layout_height="@dimen/dp_156"
|
||||
android:layout_marginTop="@dimen/dp_110"
|
||||
android:background="@color/bus_p_clock_6617417B"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextClock
|
||||
android:id="@+id/textClockHourMin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_64"
|
||||
android:format12Hour="HH:mm"
|
||||
android:format24Hour="HH:mm"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/bus_p_clock_17417B"
|
||||
android:textSize="@dimen/dp_66"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_speed_tv"
|
||||
app:layout_constraintLeft_toRightOf="@+id/dividing_line_1"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_speed_tv" />
|
||||
|
||||
<TextClock
|
||||
android:id="@+id/textClockDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:format12Hour="yyyy年MM月dd日"
|
||||
android:format24Hour="yyyy年MM月dd日"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/bus_p_clock_17417B"
|
||||
android:textSize="@dimen/dp_26"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/textClockHourMin"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textClockHourMin" />
|
||||
|
||||
|
||||
<TextClock
|
||||
android:id="@+id/textClockWeek"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:format12Hour="EEEE"
|
||||
android:format24Hour="EEEE"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/bus_p_clock_17417B"
|
||||
android:textSize="@dimen/dp_26"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/textClockDate"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textClockDate" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/split_line_iv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:src="@drawable/card_split_line_bg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dividing_line_1" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bus_p_cur_station_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_104"
|
||||
android:text="@string/bus_p_cur_station_title"
|
||||
android:textColor="@color/bus_p_line_name_color"
|
||||
android:textSize="@dimen/dp_38"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_speed_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dividing_line_1" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/speak_arrived_iv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:src="@drawable/bg_p_speak_icon_arrived"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_cur_station_title"
|
||||
app:layout_constraintLeft_toRightOf="@+id/bus_p_cur_station_title"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_cur_station_title" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bus_p_cur_station_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_57"
|
||||
android:layout_marginRight="@dimen/dp_90"
|
||||
android:background="@drawable/cur_station_arrived_bg"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_30"
|
||||
android:paddingRight="@dimen/dp_30"
|
||||
android:text="@string/bus_p_cur_station_arrived_tip"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_cur_station_title"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_cur_station_title" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bus_p_cur_station_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
android:text="-- --"
|
||||
android:textColor="@color/bus_p_clock_17417B"
|
||||
android:textSize="@dimen/dp_56"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_cur_station_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_title" />
|
||||
|
||||
<include
|
||||
layout="@layout/bus_p_no_data_common_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_name" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/bus_p_line_stations_rl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_260"
|
||||
android:paddingBottom="@dimen/dp_20"
|
||||
android:layout_height="0dp"
|
||||
android:paddingLeft="@dimen/dp_30"
|
||||
android:paddingRight="@dimen/bus_p_route_info_margin_right"
|
||||
android:paddingBottom="@dimen/dp_20"
|
||||
android:requiresFadingEdge="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dividing_line_2" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_name" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/bus_p_line_cl"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="bus_p_line_stations_rl,bus_p_cur_station_name,bus_p_cur_station_tip,
|
||||
speak_arrived_iv,bus_p_cur_station_title" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.BusPassengerMapDirectionView
|
||||
android:id="@+id/bus_p_line_map_view"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/busPLineMapView"
|
||||
android:layout_width="@dimen/bus_p_route_info_panel_width"
|
||||
android:layout_height="@dimen/bus_p_route_line_map_view_height"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_arrow_nor"
|
||||
android:layout_width="@dimen/dp_108"
|
||||
android:layout_height="@dimen/dp_107"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_370"
|
||||
android:src="@drawable/bus_p_arrow_nor"
|
||||
<com.mogo.och.bus.passenger.ui.MapAndLiveVideoView
|
||||
android:id="@+id/mapAndLiveVideoView"
|
||||
android:layout_width="@dimen/bus_p_route_info_panel_width"
|
||||
android:layout_height="@dimen/bus_p_route_line_map_view_height"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/busIndicatorView"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/driver_info_bg"
|
||||
app:layout_constraintRight_toRightOf="@+id/driver_info_bg">
|
||||
|
||||
<View
|
||||
android:id="@+id/firstIndicator"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="6dp"
|
||||
android:background="@drawable/indicator_select"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/secondIndicator"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="6dp"
|
||||
android:background="@drawable/indicator_unselect"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/firstIndicator"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/firstIndicator" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.mogo.och.common.module.wigets.OCHRoundConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -10,75 +10,51 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="--"
|
||||
android:textSize="@dimen/bus_p_station_txt_size"
|
||||
android:textStyle="bold"
|
||||
android:includeFontPadding = "false"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:layout_marginRight="@dimen/dp_60"
|
||||
android:layout_marginTop="@dimen/dp_68"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/bus_p_station_txt_color"
|
||||
android:layout_marginLeft="@dimen/dp_90"
|
||||
app:customGap="0.5"
|
||||
app:useCustomGap="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/bus_p_tag"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_arrow_bg"/>
|
||||
app:layout_constraintRight_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="62dp"
|
||||
android:layout_height="62dp"
|
||||
android:src="@drawable/bus_p_point_gray"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_circle"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_circle"
|
||||
android:id="@+id/bus_p_cur_arrow_bg"
|
||||
android:layout_width="@dimen/dp_6"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="@dimen/dp_44"
|
||||
android:background="@color/acc_default_txt_color"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_circle"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_p_circle"/>
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_p_circle"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_circle"/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_cur_arrow_bottom_bg"
|
||||
android:layout_width="@dimen/dp_6"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:background="@color/acc_default_txt_color"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_circle"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_p_circle"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_circle"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_circle"
|
||||
android:layout_width="62dp"
|
||||
android:layout_height="62dp"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_61"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/bus_p_point_blue"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_station"/>
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_cur_arrow_bg"
|
||||
android:layout_width="@dimen/dp_12"
|
||||
android:layout_height="@dimen/dp_61"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:src="@drawable/bus_p_line_blue"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_circle"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_p_circle"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_tag"
|
||||
android:layout_width="@dimen/bus_p_station_tag_width_height"
|
||||
android:layout_height="@dimen/bus_p_station_tag_width_height"
|
||||
android:background="@drawable/bg_bus_p_end_tag_bg"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_circle"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_circle"/>
|
||||
<TextView
|
||||
android:id="@+id/bus_p_tag_txt"
|
||||
android:layout_width="@dimen/bus_p_station_tag_width_height"
|
||||
android:layout_height="@dimen/bus_p_station_tag_width_height"
|
||||
android:textSize="@dimen/bus_p_station_tag_txt_size"
|
||||
android:textColor="@color/bus_p_end_tag_txt_color"
|
||||
android:text="@string/bus_p_end_station_txt_tag"
|
||||
android:includeFontPadding="false"
|
||||
android:gravity="center"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_tag"
|
||||
app:layout_constraintRight_toRightOf="@+id/bus_p_tag"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_tag"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_tag"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/group_station_tag_panel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="bus_p_tag,bus_p_tag_txt"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_18"
|
||||
android:layout_height="@dimen/dp_26">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/blueView"
|
||||
android:layout_width="@dimen/dp_18"
|
||||
android:layout_height="@dimen/dp_26"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/m2_blue_tooth_open"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"
|
||||
tools:ignore="MissingDefaultResource"
|
||||
android:background="@drawable/bg_status_bar">
|
||||
|
||||
<!--Wifi状态-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.WifiStateView
|
||||
android:id="@+id/wifiStateView"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/status_bar_logo"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_40" />
|
||||
|
||||
<!--魔方连接状态 蓝牙-->
|
||||
<com.mogo.och.bus.passenger.ui.BusPBlueToothView
|
||||
android:id="@+id/blueToothView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/wifiStateView"
|
||||
android:layout_width="@dimen/dp_15"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:src="@drawable/bus_p_blue_tooth_open"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_40" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/status_bar_logo"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginLeft="@dimen/dp_40"
|
||||
android:src="@drawable/bus_p_status_bar_logo"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="@dimen/dp_94"
|
||||
android:layout_height="@dimen/dp_25"/>
|
||||
|
||||
|
||||
|
||||
</merge>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?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="@dimen/dp_104"
|
||||
android:layout_height="@dimen/dp_58"
|
||||
android:visibility="visible">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/turn_light_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/brakelight_background_daytime"
|
||||
android:layout_gravity="top|center_horizontal"
|
||||
android:paddingLeft="@dimen/dp_10"
|
||||
android:paddingRight="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/left_nor_image"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:layout_marginLeft="@dimen/dp_5"
|
||||
android:src="@drawable/bus_p_zuozhuan_un_open" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/right_nor_image"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_gravity="right|center_vertical"
|
||||
android:layout_marginRight="@dimen/dp_5"
|
||||
android:src="@drawable/bus_p_youzhuan_un_open" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/left_select_image"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:src="@drawable/bus_p_zuozhuan_open"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/right_select_image"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_gravity="right|center_vertical"
|
||||
android:src="@drawable/bus_p_youzhuan_open"
|
||||
android:visibility="gone"/>
|
||||
</FrameLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="bus_p_speed_txt_color">#2D3E5F</color>
|
||||
<color name="bus_p_speed_txt_color">#5D7199</color>
|
||||
<color name="bus_p_traffic_light_bg_color">#CCE9EFFC</color>
|
||||
<color name="bus_p_traffic_light_bg_stroke">#C7D2E1</color>
|
||||
<color name="bus_p_driver_number_plate_color">#2D3E5F</color>
|
||||
<color name="bus_p_line_name_color">#0043FF</color>
|
||||
<color name="bus_p_line_name_color">#203555</color>
|
||||
<color name="bus_p_line_operation_time_color">#2D3E5F</color>
|
||||
<color name="bus_p_no_data_color">#596A8A</color>
|
||||
<color name="bus_p_station_circle_color">#D8E5F8</color>
|
||||
@@ -27,4 +27,15 @@
|
||||
<color name="bus_p_route_view_left_edge_shadow">#33394C63</color>
|
||||
<color name="bus_p_traffic_txt_color">#2D3E5F</color>
|
||||
<color name="bus_p_panel_edge_shadow">#33394C63</color>
|
||||
|
||||
<color name="bus_p_speed_color_start">#43CEFE</color>
|
||||
<color name="bus_p_speed_color_end">#1466FB</color>
|
||||
|
||||
<color name="bus_p_clock_17417B">#17417B</color>
|
||||
<color name="bus_p_clock_6617417B">#6617417B</color>
|
||||
<color name="bus_p_clock_A9B6CA">#A9B6CA</color>
|
||||
<color name="bus_p_clock_1F82FB">#1F82FB</color>
|
||||
|
||||
<color name="bus_p_clock_992D3E5F">#992D3E5F</color>
|
||||
|
||||
</resources>
|
||||
@@ -1,13 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="bus_p_route_info_panel_width">700dp</dimen>
|
||||
<dimen name="bus_p_route_info_panel_width">750dp</dimen>
|
||||
<dimen name="bus_p_route_bg_width">804dp</dimen>
|
||||
<dimen name="bus_p_auto_icon_margin_top">40dp</dimen>
|
||||
<dimen name="bus_p_route_info_margin_right">40dp</dimen>
|
||||
<dimen name="bus_p_route_info_margin_left">40dp</dimen>
|
||||
<dimen name="bus_p_route_info_margin_left">48dp</dimen>
|
||||
<dimen name="bus_p_route_info_margin_bottom">40dp</dimen>
|
||||
<dimen name="bus_p_route_info_margin_top">110dp</dimen>
|
||||
<dimen name="bus_p_route_line_info_height">224dp</dimen>
|
||||
<dimen name="bus_p_route_line_map_view_height">510dp</dimen>
|
||||
<dimen name="bus_p_route_line_map_view_height">422dp</dimen>
|
||||
<dimen name="bus_p_route_line_dividing_view_height">3dp</dimen>
|
||||
|
||||
<dimen name="bus_p_route_traffic_light_view_width">158dp</dimen>
|
||||
@@ -23,14 +24,14 @@
|
||||
<dimen name="bus_p_route_dividing_line2_margin_top">224dp</dimen>
|
||||
<dimen name="bus_p_driver_number_plate_margin_top">50dp</dimen>
|
||||
<dimen name="bus_p_driver_number_plate_margin_bottom">50dp</dimen>
|
||||
<dimen name="bus_p_driver_number_plate_size">44dp</dimen>
|
||||
<dimen name="bus_p_driver_number_plate_size">34dp</dimen>
|
||||
<dimen name="bus_p_line_operation_time_margin_top">130dp</dimen>
|
||||
<dimen name="bus_p_line_operation_time_size">38dp</dimen>
|
||||
|
||||
<dimen name="bus_p_no_data_size">36dp</dimen>
|
||||
<dimen name="bus_p_no_data_size">38dp</dimen>
|
||||
|
||||
<dimen name="bus_p_speed_txt_size">110dp</dimen>
|
||||
<dimen name="bus_p_speed_unit_txt_size">42dp</dimen>
|
||||
<dimen name="bus_p_speed_txt_size">90dp</dimen>
|
||||
<dimen name="bus_p_speed_unit_txt_size">27dp</dimen>
|
||||
|
||||
<dimen name="bus_p_station_circle_borner_size">4dp</dimen>
|
||||
<dimen name="bus_p_station_circle_radius_size">10dp</dimen>
|
||||
@@ -40,7 +41,7 @@
|
||||
<dimen name="bus_p_cur_station_circle_width">20dp</dimen>
|
||||
<dimen name="bus_p_cur_station_circle_height">50dp</dimen>
|
||||
<dimen name="bus_p_mid_station_circle_cor">6dp</dimen>
|
||||
<dimen name="bus_p_station_txt_size">50dp</dimen>
|
||||
<dimen name="bus_p_station_txt_size">38dp</dimen>
|
||||
<dimen name="bus_p_station_tag_txt_size">36dp</dimen>
|
||||
<dimen name="bus_p_station_item_height">80dp</dimen>
|
||||
<dimen name="bus_p_station_item_middle_height">100dp</dimen>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="bus_p_speed_unit_txt">KM/H</string>
|
||||
<string name="bus_p_no_out">您已收车</string>
|
||||
<string name="bus_p_no_task">暂无班次</string>
|
||||
<string name="bus_p_no_line" tools:ignore="ExtraTranslation">暂无线路</string>
|
||||
<string name="bus_p_start_station_txt_tag">起</string>
|
||||
<string name="bus_p_end_station_txt_tag">终</string>
|
||||
<string name="bus_p_cur_station_title">到达站:</string>
|
||||
<string name="bus_p_cur_next_station_title">下一站:</string>
|
||||
<string name="bus_p_cur_station_title_init">始发站:</string>
|
||||
<string name="bus_p_cur_station_arrived_tip">请携带好随身物品下车。</string>
|
||||
<string name="bus_p_cur_station_arrived_tip_init">欢迎乘坐\'蘑菇车联\'自动驾驶车。</string>
|
||||
<string name="bus_p_cur_station_title">已到站:</string>
|
||||
<string name="bus_p_cur_next_station_title">前方到站:</string>
|
||||
<!-- <string name="bus_p_cur_station_title_init">始发站:</string>-->
|
||||
<string name="bus_p_cur_station_arrived_tip">请按秩序下车</string>
|
||||
<!-- <string name="bus_p_cur_station_arrived_tip_init">欢迎乘坐蘑菇车联自动驾驶车。</string>-->
|
||||
</resources>
|
||||
@@ -1,5 +1,4 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
|
||||
@@ -51,13 +50,6 @@ android {
|
||||
dimension "vehicle"
|
||||
buildConfigField 'int', 'NEW_TEST', '0'
|
||||
}
|
||||
|
||||
// 小巴车 接驳车 这个维度应该放入的最外层 但是和小巴的代码耦合的太严重放到了这个地方
|
||||
// 乘客端删除了这个flavors 是因为乘客端这个地方比较简单
|
||||
shuttle {
|
||||
dimension "vehicle"
|
||||
buildConfigField 'int', 'NEW_TEST', '1'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_STOPPED;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -620,6 +621,20 @@ public class OrderModel {
|
||||
*/
|
||||
private void startAutopilot(boolean isRestart, int leaveIndex) {
|
||||
|
||||
//根据开关和后台是否发布轨迹启动自驾
|
||||
if (FunctionBuildConfig.isPassStartAutopilotCommand && TextUtils.isEmpty(busRoutesResult.csvFileUrl)
|
||||
&& TextUtils.isEmpty(busRoutesResult.csvFileUrlDPQP)){
|
||||
ToastUtils.showLong("无发布轨迹, 请发布后重试");
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "isPassStartAutopilotCommand = " +
|
||||
FunctionBuildConfig.isPassStartAutopilotCommand
|
||||
+ "busRoutesResult.csvFileUrl = "+ busRoutesResult.csvFileUrl
|
||||
+ "busRoutesResult.csvFileUrlDPQP = "+busRoutesResult.csvFileUrlDPQP);
|
||||
return;
|
||||
}
|
||||
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "isPassStartAutopilotCommand = " +
|
||||
FunctionBuildConfig.isPassStartAutopilotCommand);
|
||||
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
|
||||
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
|
||||
", 请稍候重试");
|
||||
|
||||
@@ -21,7 +21,6 @@ import androidx.constraintlayout.widget.Group;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
@@ -29,17 +28,14 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView;
|
||||
import com.mogo.eagle.core.function.smp.view.SmallMapView;
|
||||
import com.mogo.eagle.core.function.view.MapBizView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
@@ -77,7 +73,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
protected TextView tvArrived;
|
||||
protected RelativeLayout mSettingBtn;
|
||||
protected RelativeLayout mBadcaseBtn;
|
||||
protected RelativeLayout mAICollectBtn;
|
||||
private FrameLayout flStationPanelContainer;
|
||||
private MapBizView mapBizView;
|
||||
private Group groupTestPanel;
|
||||
@@ -147,18 +142,12 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
if (controller != null) {
|
||||
//切换地图的远近视图
|
||||
if (controller.getCurrentMapVisualAngle().isLongSight()) {
|
||||
CallerVisualAngleManager.INSTANCE.updateLongSightLevel(false);
|
||||
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
|
||||
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
|
||||
CallerVisualAngleManager.INSTANCE.updateLongSightLevel(true);
|
||||
if (FunctionBuildConfig.isRomaMode) {
|
||||
controller.setRomaMode(1);
|
||||
} else {
|
||||
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
|
||||
}
|
||||
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
|
||||
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
|
||||
} else {
|
||||
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
||||
@@ -222,21 +211,17 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
|
||||
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl);
|
||||
if (mAICollectBtn != null) {
|
||||
CallerDevaToolsManager.INSTANCE.initAiCollect(mAICollectBtn);
|
||||
}
|
||||
//消息盒子
|
||||
viewDriverMsgBoxButton = findViewById(R.id.viewDriverMsgBoxButton);
|
||||
viewDriverMsgBoxList = findViewById(R.id.viewDriverMsgBoxList);
|
||||
viewDriverMsgBoxBubble = findViewById(R.id.viewDriverMsgBoxBubble);
|
||||
viewDriverMsgBoxButton.setClickListener(show -> {
|
||||
if(show){
|
||||
if (show) {
|
||||
viewDriverMsgBoxList.setVisibility(View.VISIBLE);
|
||||
viewDriverMsgBoxList.notifyData();
|
||||
viewDriverMsgBoxBubble.setVisibility(View.GONE);
|
||||
viewDriverMsgBoxBubble.isShowData(false);
|
||||
}else{
|
||||
} else {
|
||||
viewDriverMsgBoxList.setVisibility(View.GONE);
|
||||
viewDriverMsgBoxBubble.setVisibility(View.VISIBLE);
|
||||
viewDriverMsgBoxBubble.isShowData(true);
|
||||
|
||||
@@ -7,12 +7,10 @@ import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
@@ -25,8 +23,10 @@ import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
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.ToastUtils;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.overlay.core.Level;
|
||||
import com.mogo.map.overlay.point.Point;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.bus.bean.BusStationBean;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
@@ -43,12 +43,9 @@ import com.mogo.och.common.module.utils.QRUtilsKt;
|
||||
import com.mogo.och.common.module.wigets.BindQRCodeDialog;
|
||||
import com.mogo.och.common.module.wigets.MarqueeTextView;
|
||||
import com.mogo.och.common.module.wigets.OCHCommitDialog;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils;
|
||||
|
||||
@@ -485,20 +482,29 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
CallerLogger.INSTANCE.d(M_BUS + "setMapMaker= "+Thread.currentThread().getName(),
|
||||
uuid + "=latitude=" + lat + ",longitude=" + longi);
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner(BusConst.TYPE_MARKER_BUS_ORDER)
|
||||
Point.Options.Builder builder = new Point.Options.Builder(BusConst.TYPE_MARKER_BUS_ORDER, Level.MAP_MARKER)
|
||||
.setId(uuid)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.gps(true)
|
||||
.isUseGps(true)
|
||||
.controlAngle(true)
|
||||
.icon3DRes(resourceId)
|
||||
.latitude(lat)
|
||||
.longitude(longi);
|
||||
IMogoMarker marker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).addMarker(uuid, options);
|
||||
CenterLine centerLine = CallerMapUIServiceManager.INSTANCE.getMapUIController().getCenterLineInfo(
|
||||
longi,lat,-1);
|
||||
if (null != centerLine && marker != null) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
|
||||
marker.setRotateAngle(centerLine.getAngle().floatValue());
|
||||
IMogoMapUIController mapUIController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
||||
if (mapUIController != null) {
|
||||
CenterLine centerLine = mapUIController.getCenterLineInfo(
|
||||
longi,lat,-1);
|
||||
if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
|
||||
Double angle = centerLine.getAngle();
|
||||
if (angle != null) {
|
||||
builder.rotate(angle.floatValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
if (overlayManager != null) {
|
||||
overlayManager.showOrUpdatePoint(builder.build());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -508,7 +514,10 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
Runnable removeMapMarkerRunnable = () -> {
|
||||
CallerLogger.INSTANCE.d(M_BUS + "RemoveMapMaker="+Thread.currentThread().getName(),
|
||||
uuid+"=latitude="+lat+",longitude="+longi);
|
||||
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerManager(AbsMogoApplication.getApp())).removeMarkers(uuid);
|
||||
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
if (overlayManager != null) {
|
||||
overlayManager.removePoint(uuid);
|
||||
}
|
||||
};
|
||||
OCHThreadPoolManager.getsInstance().execute(removeMapMarkerRunnable);
|
||||
}
|
||||
|
||||
@@ -169,7 +169,6 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
||||
if (autopilotStatusInfo == null) return;
|
||||
int state = autopilotStatusInfo.getState();
|
||||
// CallerLogger.INSTANCE.d(M_BUS + TAG, "onStateChange: " + state + "currentAutopilotStatus = " + currentAutopilotStatus);
|
||||
switch (state) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.och.bus.R
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse
|
||||
import com.mogo.och.bus.ui.adapter.SwitchLineAdapter.SwitchLineViewHolder
|
||||
import java.lang.Exception
|
||||
import kotlin.text.StringBuilder
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
|
||||
android:layout_width="@dimen/dp_400"
|
||||
@@ -36,11 +36,6 @@
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<!--浓雾预警动画-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XFogEventView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<!--V2X预警红色边框-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
|
||||
android:layout_width="match_parent"
|
||||
@@ -299,21 +294,15 @@
|
||||
android:src="@drawable/icon_bad_case" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_ai_collet_rl"
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaBusView
|
||||
android:layout_width="@dimen/dp_172"
|
||||
android:layout_height="@dimen/dp_172"
|
||||
android:background="@drawable/bus_operation_status_bg_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/icon_ai_collect" />
|
||||
</RelativeLayout>
|
||||
app:layout_constraintBottom_toBottomOf="@id/module_mogo_och_badcase_rl"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl"
|
||||
app:layout_constraintTop_toTopOf="@id/module_mogo_och_badcase_rl"
|
||||
app:roma_open_bg="@drawable/bus_operation_status_select_bg"
|
||||
app:roma_close_bg="@drawable/bus_operation_status_bg"
|
||||
/>
|
||||
|
||||
<com.mogo.och.bus.view.SlidePanelView
|
||||
android:id="@+id/module_mogo_och_slide_panel"
|
||||
@@ -411,7 +400,6 @@
|
||||
android:layout_marginBottom="30dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,5 +1,4 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
@@ -45,14 +44,6 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions "vehicle"
|
||||
productFlavors {
|
||||
// 车型:金旅m1 包车业务
|
||||
m1 {
|
||||
dimension "vehicle"
|
||||
buildConfigField 'int', 'NEW_TEST', '1'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.bean.request
|
||||
|
||||
data class ArriveDestRequest(val sn:String, val lineId:Long)
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.callback;
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
*
|
||||
* Model->Presenter回调:ADAS相关(自动驾驶状态回调,到达终点等等)
|
||||
*/
|
||||
public interface IBusPassengerADASStatusCallback {
|
||||
// 自动驾驶触发的已到达目的地:暂未用到
|
||||
void onAutopilotArriveEnd();
|
||||
|
||||
// 自动驾驶可用状态
|
||||
void onAutopilotEnable();
|
||||
|
||||
// 自动驾驶不可用状态
|
||||
void onAutopilotDisable();
|
||||
|
||||
// 自动驾驶运行中
|
||||
void onAutopilotRunning();
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.model
|
||||
|
||||
/**
|
||||
* Created on 2022/08/19
|
||||
*
|
||||
*
|
||||
* 0 初始状态,
|
||||
* 10 已登录,
|
||||
* 20 已登出,
|
||||
*/
|
||||
enum class OrderStatusEnum(val code: Int) {
|
||||
Nothing(0),
|
||||
NoOrderUnuse( 10 ), //无订单车闲置 m1_order_noorder.xml 无订单页面
|
||||
OrderNoLine( 20), //有订单无线路 m1_order_lineside 选择线路页面
|
||||
OrdersWithLine( 30), //有订单有线路 m1_order_lineside 选择线路页面隐藏掉确定取消
|
||||
NoOrderUse( 40),; //无订单车不闲置 m1_order_end.xml 开门关门页面
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun valueOf(code: Int): OrderStatusEnum? {
|
||||
for (value in values()) {
|
||||
if (value.code == code) {
|
||||
return value
|
||||
}
|
||||
}
|
||||
return NoOrderUnuse
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface IOrderStatusChangeListener {
|
||||
fun onStatusChange(currentStatus:OrderStatusEnum)
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.presenter
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.ui.M1CarUserNoOrderFragment
|
||||
import com.mogo.och.common.module.manager.OCHM1LightAirconditionDoorStatusManager
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
class BusPassengerCarUseAndNoOrderPresenter(view: M1CarUserNoOrderFragment?) :
|
||||
BusBasePassengerFunctionDevicePresenter<M1CarUserNoOrderFragment?>(view),
|
||||
OCHM1LightAirconditionDoorStatusManager.OCHM1LightAirconditionDoorCallback {
|
||||
companion object {
|
||||
private const val TAG = "BusPassengerFunctionPresenter"
|
||||
}
|
||||
|
||||
private var subscribe: Disposable? = null
|
||||
private var subscribeDoorStatus: Disposable? = null
|
||||
private var gnssSpeed = 0.0
|
||||
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
super.onCreate(owner)
|
||||
OCHM1LightAirconditionDoorStatusManager.addListener(TAG, this)
|
||||
CharterPassengerModel.setControllerStatusCallback(TAG) { location ->
|
||||
location?.let {
|
||||
gnssSpeed = it.gnssInfo.vehicleSpeed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
super.onDestroy(owner)
|
||||
OCHM1LightAirconditionDoorStatusManager.removeListener(TAG)
|
||||
disposeSubscribe(subscribe)
|
||||
disposeSubscribe(subscribeDoorStatus)
|
||||
}
|
||||
|
||||
override fun onDoorStatusCallback(isOpen: Boolean, isFirst: Boolean) {
|
||||
if (!isFirst) {
|
||||
if (isOpen) {
|
||||
ToastUtils.showShort("已开启车门")
|
||||
} else {
|
||||
ToastUtils.showShort("已关门车门")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun openDoor() {
|
||||
val canOpenOrCloseDoor = canOpenOrCloseDoor()
|
||||
if (!canOpenOrCloseDoor.isNullOrEmpty()) {
|
||||
ToastUtils.showShort(canOpenOrCloseDoor)
|
||||
return
|
||||
}
|
||||
disposeSubscribe(subscribe)
|
||||
subscribe = createSubscribe(1000) {
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(0)
|
||||
}
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(1)
|
||||
disposeSubscribe(subscribeDoorStatus)
|
||||
subscribeDoorStatus = createSubscribe {
|
||||
if (!OCHM1LightAirconditionDoorStatusManager.doorStatus.isOpen) {
|
||||
ToastUtils.showShort("车门无法开启,请使用车内物理按钮")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun closeDoor() {
|
||||
val canOpenOrCloseDoor = canOpenOrCloseDoor()
|
||||
if (!canOpenOrCloseDoor.isNullOrBlank()) {
|
||||
ToastUtils.showShort(canOpenOrCloseDoor)
|
||||
return
|
||||
}
|
||||
disposeSubscribe(subscribe)
|
||||
subscribe = createSubscribe(1000) {
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(0)
|
||||
}
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(2)
|
||||
disposeSubscribe(subscribeDoorStatus)
|
||||
subscribeDoorStatus = createSubscribe {
|
||||
if (OCHM1LightAirconditionDoorStatusManager.doorStatus.isOpen) {
|
||||
ToastUtils.showShort("车门无法关闭,请使用车内物理按钮")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun canOpenOrCloseDoor(): String? {
|
||||
if (gnssSpeed < 0.01) {
|
||||
return null
|
||||
} else {
|
||||
return "车辆正在运行、请稍后再试"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.presenter
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
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.util.ToastUtils
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.ui.M1DeviceFragment
|
||||
import com.mogo.och.common.module.manager.OCHM1LightAirconditionDoorStatusManager
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
class BusPassengerFunctionDevicePresenter(view: M1DeviceFragment?) :
|
||||
BusBasePassengerFunctionDevicePresenter<M1DeviceFragment?>(view),
|
||||
OCHM1LightAirconditionDoorStatusManager.OCHM1LightAirconditionDoorCallback {
|
||||
|
||||
private var subscribe: Disposable? = null
|
||||
private var subscribeDoorStatus: Disposable? = null
|
||||
private var gnssSpeed =0.0
|
||||
|
||||
companion object {
|
||||
private const val TAG = "BusPassengerFunctionDevicePresenter"
|
||||
}
|
||||
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
super.onCreate(owner)
|
||||
OCHM1LightAirconditionDoorStatusManager.addListener(TAG, this)
|
||||
CharterPassengerModel.setControllerStatusCallback(TAG) { location ->
|
||||
location?.let {
|
||||
gnssSpeed = it.gnssInfo.vehicleSpeed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
super.onDestroy(owner)
|
||||
OCHM1LightAirconditionDoorStatusManager.removeListener(TAG)
|
||||
disposeSubscribe(subscribe)
|
||||
disposeSubscribe(subscribeDoorStatus)
|
||||
}
|
||||
|
||||
override fun onDoorStatusCallback(isOpen: Boolean,isFirst: Boolean) {
|
||||
if(!isFirst) {
|
||||
if (isOpen) {
|
||||
ToastUtils.showShort("已开启车门")
|
||||
} else {
|
||||
ToastUtils.showShort("已关门车门")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun openDoor() {
|
||||
val canOpenOrCloseDoor = canOpenOrCloseDoor()
|
||||
if(!canOpenOrCloseDoor.isNullOrEmpty()){
|
||||
ToastUtils.showShort(canOpenOrCloseDoor)
|
||||
return
|
||||
}
|
||||
disposeSubscribe(subscribe)
|
||||
subscribe = createSubscribe(1000) {
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(0)
|
||||
}
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(1)
|
||||
disposeSubscribe(subscribeDoorStatus)
|
||||
subscribeDoorStatus = createSubscribe(6000) {
|
||||
if (!OCHM1LightAirconditionDoorStatusManager.doorStatus.isOpen) {
|
||||
ToastUtils.showShort("车门无法开启,请使用车内物理按钮")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun closeDoor() {
|
||||
val canOpenOrCloseDoor = canOpenOrCloseDoor()
|
||||
if(!canOpenOrCloseDoor.isNullOrBlank()){
|
||||
ToastUtils.showShort(canOpenOrCloseDoor)
|
||||
return
|
||||
}
|
||||
disposeSubscribe(subscribe)
|
||||
subscribe = createSubscribe(1000) {
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(0)
|
||||
}
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(2)
|
||||
disposeSubscribe(subscribeDoorStatus)
|
||||
subscribeDoorStatus = createSubscribe(6000) {
|
||||
if (OCHM1LightAirconditionDoorStatusManager.doorStatus.isOpen) {
|
||||
ToastUtils.showShort("车门无法关闭,请使用车内物理按钮")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun canOpenOrCloseDoor():String?{
|
||||
if(gnssSpeed<0.01){
|
||||
return null
|
||||
}else{
|
||||
return "车辆正在运行、请稍后再试"
|
||||
}
|
||||
}
|
||||
|
||||
// 靠边停车
|
||||
fun startStopSide() {
|
||||
when (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
|
||||
ToastUtils.showShort("设备未就绪请稍等,请稍后再试")
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
|
||||
ToastUtils.showShort("因车辆正在人工驾驶中无法靠边停车,请稍后再试")
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
// 靠边停车
|
||||
CallerAutoPilotControlManager.sendPlanningCmd(1)
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
|
||||
ToastUtils.showShort("因车辆正在平行驾驶中无法靠边停车,请稍后再试")
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
fun startGo() {
|
||||
when (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
|
||||
ToastUtils.showShort("设备未就绪请稍等")
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
|
||||
ToastUtils.showShort("启动自动驾驶中")
|
||||
CallerAutoPilotControlManager.sendPlanningCmd(2)
|
||||
CharterPassengerModel.startAutopilot()
|
||||
CharterPassengerModel.leaveStation()
|
||||
CharterPassengerModel.sendTripInfo()
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
// 重新起步
|
||||
CallerAutoPilotControlManager.sendPlanningCmd(2)
|
||||
CharterPassengerModel.leaveStation()
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
|
||||
ToastUtils.showShort("因车辆正在平行驾驶中无法靠边停车,请稍后再试")
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.presenter
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.model.OrderStatusEnum
|
||||
import com.mogo.och.bus.passenger.ui.M1EarlyEndOrderFragment
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
|
||||
class BusPassengerFunctionEarlyEndOrderPresenter(view: M1EarlyEndOrderFragment?) :
|
||||
BusBasePassengerFunctionDevicePresenter<M1EarlyEndOrderFragment?>(view) {
|
||||
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
super.onCreate(owner)
|
||||
}
|
||||
|
||||
override fun onResume(owner: LifecycleOwner) {
|
||||
super.onResume(owner)
|
||||
}
|
||||
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
super.onDestroy(owner)
|
||||
|
||||
}
|
||||
|
||||
fun endOrder() {
|
||||
CharterPassengerModel.endOrder(object : OchCommonServiceCallback<BaseData> {
|
||||
override fun onSuccess(data: BaseData?) {
|
||||
if (null != data && 0 == data.code) {
|
||||
ToastUtils.showShort("结束成功")
|
||||
CharterPassengerModel.setEndOrderStatus()
|
||||
mView?.closeDialogContaion()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
ToastUtils.showShort("$code:$msg")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.presenter
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.model.IOrderStatusChangeListener
|
||||
import com.mogo.och.bus.passenger.model.OrderStatusEnum
|
||||
import com.mogo.och.bus.passenger.ui.M1OrderFragment
|
||||
|
||||
class BusPassengerFunctionOrderPresenter(view: M1OrderFragment?) :
|
||||
BusBasePassengerFunctionDevicePresenter<M1OrderFragment?>(view), IOrderStatusChangeListener {
|
||||
|
||||
companion object{
|
||||
const val TAG = "BusPassengerFunctionOrderPresenter"
|
||||
}
|
||||
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
super.onCreate(owner)
|
||||
CharterPassengerModel.setStatusChangeListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun onResume(owner: LifecycleOwner) {
|
||||
super.onResume(owner)
|
||||
mView?.setViewByOrderStatus(CharterPassengerModel.getCurrentOrderStatus())
|
||||
}
|
||||
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
super.onDestroy(owner)
|
||||
CharterPassengerModel.setStatusChangeListener(TAG,null)
|
||||
}
|
||||
override fun onStatusChange(currentStatus: OrderStatusEnum) {
|
||||
mView?.setViewByOrderStatus(currentStatus)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,293 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.presenter
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.response.OrderInfoResponse
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerControllerStatusCallback
|
||||
import com.mogo.och.bus.passenger.callback.IOrderChangeCallback
|
||||
import com.mogo.och.bus.passenger.callback.IDistanceTimeCallback
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.model.IOrderStatusChangeListener
|
||||
import com.mogo.och.bus.passenger.model.OrderStatusEnum
|
||||
import com.mogo.och.bus.passenger.ui.MainFragment
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPMsgType
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.OCHM1LightAirconditionDoorStatusManager
|
||||
import com.mogo.och.common.module.manager.OCHPlanningStopSideStatusManager
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper
|
||||
import com.mogo.och.common.module.voice.VoiceNotice
|
||||
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPCommonOperationMsg
|
||||
import io.reactivex.disposables.Disposable
|
||||
import java.util.*
|
||||
|
||||
class BusPassengerPresenter(view: MainFragment?) :
|
||||
BusBasePassengerFunctionDevicePresenter<MainFragment?>(view),
|
||||
IBusPassengerControllerStatusCallback, IDistanceTimeCallback, IOrderChangeCallback,
|
||||
IOrderStatusChangeListener, OCHPlanningStopSideStatusManager.OCHPlanningActionsCallback {
|
||||
|
||||
private var subscribe: Disposable? = null
|
||||
private var gnssSpeed = 0.0f
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
super.onCreate(owner)
|
||||
CharterPassengerModel.init()
|
||||
// 定位监听
|
||||
CharterPassengerModel.setControllerStatusCallback(TAG,this)
|
||||
CharterPassengerModel.setiDistanceTimeCallback(this)
|
||||
CharterPassengerModel.setCarTypeChangeListener(this)
|
||||
CharterPassengerModel.setStatusChangeListener(TAG,this)
|
||||
CallerTelematicListenerManager.addListener(TAG, msgReceived)
|
||||
OCHPlanningStopSideStatusManager.addListener(TAG,this)
|
||||
setCarChangeListener(R.raw.m1)
|
||||
//BusPassengerModel.setMoGoAutopilotPlanningListener(this)
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
super.onDestroy(owner)
|
||||
CharterPassengerModel.setControllerStatusCallback(TAG,null)
|
||||
CharterPassengerModel.setiDistanceTimeCallback(null)
|
||||
CharterPassengerModel.setCarTypeChangeListener(null)
|
||||
CallerTelematicListenerManager.removeListener(TAG)
|
||||
OCHPlanningStopSideStatusManager.removeListener(TAG)
|
||||
}
|
||||
private fun setSpeed(speed:Float){
|
||||
UiThreadHandler.post {
|
||||
val speedKM =(Math.abs(speed) * 3.6f).toInt()
|
||||
mView?.setSpeed(speedKM.toString())
|
||||
}
|
||||
}
|
||||
private fun setDistanceAndTime(distance: String,distanceUnit: String){
|
||||
UiThreadHandler.post {
|
||||
mView?.setDistanceAndTime(distance, distanceUnit)
|
||||
}
|
||||
}
|
||||
private fun setOrderTime(sumTime:String,arrivedTime:String){
|
||||
UiThreadHandler.post {
|
||||
mView?.setOrderTime(sumTime, arrivedTime)
|
||||
}
|
||||
}
|
||||
override fun onCarLocationChanged(location: MogoLocation?) {
|
||||
location?.let {
|
||||
setSpeed(it.gnssSpeed)
|
||||
gnssSpeed = it.gnssSpeed
|
||||
}
|
||||
}
|
||||
|
||||
val msgReceived = object : IReceivedMsgListener {
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
UiThreadHandler.post {
|
||||
if (type == OchCommonConst.BUSINESS_STRING) {
|
||||
val msg = GsonUtils.fromJson(
|
||||
String(byteArray),
|
||||
BaseDPMsg::class.java
|
||||
) as BaseDPMsg
|
||||
when (msg.type) {
|
||||
DPMsgType.TYPE_OPEN_CLOSE_DOOR.type -> {
|
||||
val doorStatus = OCHM1LightAirconditionDoorStatusManager.doorStatus
|
||||
if(doorStatus.isOpen){
|
||||
closeDoor()
|
||||
}else{
|
||||
openDoor()
|
||||
}
|
||||
}
|
||||
DPMsgType.TYPE_COMMON.type -> {
|
||||
val msg = GsonUtils.fromJson(
|
||||
String(byteArray),
|
||||
DPCommonOperationMsg::class.java
|
||||
) as DPCommonOperationMsg
|
||||
pushOperationalToMsgBox(DateTimeUtil.getCurrentTimeStamp(),msg.msg)
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun pushOperationalToMsgBox(time : Long,content : String,type: Int = -1){
|
||||
playDI()
|
||||
OCHSocketMessageManager.pushAppOperationalMsgBox(time, content, type)
|
||||
}
|
||||
|
||||
private fun playDI(){
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.m1_voice_di)
|
||||
}
|
||||
|
||||
fun openDoor() {
|
||||
val canOpenOrCloseDoor = canOpenOrCloseDoor()
|
||||
if(!canOpenOrCloseDoor.isNullOrEmpty()){
|
||||
ToastUtils.showShort(canOpenOrCloseDoor)
|
||||
return
|
||||
}
|
||||
disposeSubscribe(subscribe)
|
||||
subscribe = createSubscribe(1000) {
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(0)
|
||||
}
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(1)
|
||||
}
|
||||
|
||||
fun closeDoor() {
|
||||
val canOpenOrCloseDoor = canOpenOrCloseDoor()
|
||||
if(!canOpenOrCloseDoor.isNullOrBlank()){
|
||||
ToastUtils.showShort(canOpenOrCloseDoor)
|
||||
return
|
||||
}
|
||||
disposeSubscribe(subscribe)
|
||||
subscribe = createSubscribe(1000) {
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(0)
|
||||
}
|
||||
CallerAutoPilotControlManager.sendRoboBusJinlvM1FrontDoorCmd(2)
|
||||
}
|
||||
|
||||
private fun canOpenOrCloseDoor():String?{
|
||||
if(gnssSpeed<0.01){
|
||||
return null
|
||||
}else{
|
||||
return "车辆正在运行、请稍后再试"
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算剩余距离和剩余时间
|
||||
*/
|
||||
override fun setDistancecAndTime(meters: Long, timeInSecond: Long) {
|
||||
var dis: String? = "0"
|
||||
var disUnit = "KM"
|
||||
if (meters > 0) {
|
||||
if (meters / 1000 < 1) {
|
||||
disUnit = "M"
|
||||
dis = Math.round(meters.toFloat()).toString()
|
||||
} else {
|
||||
disUnit = "KM"
|
||||
dis = NumberFormatUtil.formatLong(meters.toDouble() / 1000)
|
||||
}
|
||||
}
|
||||
setDistanceAndTime(dis.toString(),disUnit)
|
||||
}
|
||||
|
||||
override fun setOrderTimeCallBack(timeInSecond: Long) {
|
||||
if(timeInSecond<0){
|
||||
setDistanceAndTime("0", "KM")
|
||||
setOrderTime("--","--")
|
||||
return
|
||||
}
|
||||
var surplusTime = (timeInSecond / 60).toInt()
|
||||
if(surplusTime==0){
|
||||
surplusTime = 1
|
||||
}
|
||||
|
||||
val beforeTime = Calendar.getInstance()
|
||||
beforeTime.add(Calendar.SECOND, timeInSecond.toInt())
|
||||
//到达时间
|
||||
val arriveTime = DateTimeUtil.formatCalendarToString(beforeTime, DateTimeUtil.HH_mm)
|
||||
setOrderTime(surplusTime.toString(),arriveTime)
|
||||
}
|
||||
|
||||
companion object{
|
||||
private const val TAG = "BusPassengerPresenter"
|
||||
}
|
||||
|
||||
override fun setCarChangeListener(productType: Int?) {
|
||||
when (productType) {
|
||||
OrderInfoResponse.M1_LOVE -> {
|
||||
mView?.setCarModle(R.raw.aiqinghao)
|
||||
}
|
||||
OrderInfoResponse.M1_FAMILY -> {
|
||||
mView?.setCarModle(R.raw.jiatinghao)
|
||||
}
|
||||
OrderInfoResponse.M1_FRIENDLY -> {
|
||||
mView?.setCarModle(R.raw.pengyouhao)
|
||||
}
|
||||
else -> {
|
||||
mView?.setCarModle(R.raw.m1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun haveOrder():Boolean {
|
||||
return CharterPassengerModel.hasOrder()
|
||||
}
|
||||
|
||||
override fun onStatusChange(currentStatus: OrderStatusEnum) {
|
||||
when (currentStatus) {
|
||||
OrderStatusEnum.Nothing -> {}
|
||||
OrderStatusEnum.NoOrderUnuse -> {
|
||||
mView?.closeOpenAndCloseDoor()
|
||||
}
|
||||
OrderStatusEnum.OrderNoLine -> {}
|
||||
OrderStatusEnum.OrdersWithLine -> {}
|
||||
OrderStatusEnum.NoOrderUse -> {
|
||||
when (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
|
||||
ToastUtils.showShort("设备未就绪请稍等,请安全员主动停止车辆")
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
|
||||
ToastUtils.showShort("因车辆正在人工驾驶中无法靠边停车,请安全员主动停止车辆")
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
// 靠边停车 订单结束 靠边停车
|
||||
CallerAutoPilotControlManager.sendPlanningCmd(1)
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
|
||||
ToastUtils.showShort("因车辆正在平行驾驶中无法靠边停车,请安全员主动停止车辆")
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
UiThreadHandler.post {
|
||||
mView?.showOpenAndCloseDoor()
|
||||
mView?.cleanEndStation()
|
||||
setDistanceAndTime("0", "KM")
|
||||
setOrderTime("--","--")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun setEndStationCallBack(siteId: Long?, siteName: String?, gcj_lon: Double, gcj_lat: Double) {
|
||||
val latLng = LatLng(gcj_lat,gcj_lon)
|
||||
mView?.cleanEndStation()
|
||||
mView?.drawEndStation(latLng)
|
||||
}
|
||||
|
||||
override fun onStartAutopilotFailure(
|
||||
actionStatus: OCHPlanningStopSideStatusManager.Status,
|
||||
stopSideStatus: Boolean?,
|
||||
errorInfo: String?
|
||||
) {
|
||||
UiThreadHandler.post {
|
||||
when (actionStatus) {
|
||||
OCHPlanningStopSideStatusManager.Status.NOSTART -> {
|
||||
ToastUtils.showShort(errorInfo)
|
||||
}
|
||||
OCHPlanningStopSideStatusManager.Status.START -> {
|
||||
VoiceNotice.showNotice(context.getString(R.string.m1_stop_site_zh), AIAssist.LEVEL1)
|
||||
}
|
||||
OCHPlanningStopSideStatusManager.Status.DOING -> {
|
||||
// 正在靠边停车
|
||||
}
|
||||
OCHPlanningStopSideStatusManager.Status.EndingSuccess -> {
|
||||
ToastUtils.showShort("靠边停车成功")
|
||||
}
|
||||
OCHPlanningStopSideStatusManager.Status.EndingFaile -> {
|
||||
ToastUtils.showShort("靠边停车失败")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,288 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.widget.CompoundButton
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.fragment.app.FragmentTransaction
|
||||
import com.mogo.commons.mvp.MvpDialogFragment
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.SharedPrefs
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerFunctionPresenter
|
||||
import kotlinx.android.synthetic.m1.m1_contain_fragment.*
|
||||
|
||||
/**
|
||||
* @author: yangyakun
|
||||
* @date: 2023/1/28
|
||||
*/
|
||||
class M1ContainFragment :
|
||||
MvpDialogFragment<M1ContainFragment?, BusPassengerFunctionPresenter?>() {
|
||||
|
||||
var tab: String = VIDEOTAB
|
||||
var fragmentTag: String = M1VideoFragment.TAG
|
||||
var fragment: Fragment? = null
|
||||
var isEarlyClose:Boolean = false
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
arguments?.let {
|
||||
tab = it.getString(SELECTTAB, VIDEOTAB)
|
||||
}
|
||||
savedInstanceState?.let {
|
||||
tab = it.getString(SELECTTAB, tab)
|
||||
}
|
||||
isEarlyClose = tab==SETTINGENDORDERTAB
|
||||
setStyle(STYLE_NO_TITLE, R.style.DialogFullScreen) //dialog全屏
|
||||
}
|
||||
|
||||
private fun initFragment() {
|
||||
when (tab) {
|
||||
VIDEOTAB -> {
|
||||
fragment =
|
||||
childFragmentManager.findFragmentByTag(M1VideoFragment.TAG)
|
||||
?: M1VideoFragment.newInstance()
|
||||
}
|
||||
SETTINGDEVICETAB -> {
|
||||
fragment =
|
||||
childFragmentManager.findFragmentByTag(M1DeviceFragment.TAG)
|
||||
?: M1DeviceFragment.newInstance()
|
||||
}
|
||||
SETTINGSOFTTAB -> {
|
||||
fragment =
|
||||
childFragmentManager.findFragmentByTag(M1SoftFragment.TAG)
|
||||
?: M1SoftFragment.newInstance()
|
||||
}
|
||||
SETTINGORDERTAB -> {
|
||||
fragment =
|
||||
childFragmentManager.findFragmentByTag(M1OrderFragment.TAG)
|
||||
?: M1OrderFragment.newInstance(object :ChangeCheck{
|
||||
override fun changeChange() {
|
||||
cb_bp_setting_device.isChecked = true
|
||||
}
|
||||
})
|
||||
}
|
||||
SETTINGENDORDERTAB -> {
|
||||
fragment =
|
||||
childFragmentManager.findFragmentByTag(M1EarlyEndOrderFragment.TAG)
|
||||
?: M1EarlyEndOrderFragment.newInstance(object :ContainDismiss{
|
||||
override fun closeDialog() {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
})
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
fragment?.let {
|
||||
childFragmentManager.beginTransaction()
|
||||
.replace(R.id.fl_function_group, it, fragmentTag)
|
||||
.commitNow()
|
||||
}
|
||||
cl_container.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.m1_contain_fragment
|
||||
|
||||
override fun getTagName(): String = TAG
|
||||
|
||||
override fun initViews() {
|
||||
|
||||
//dialog?.setCancelable(false)
|
||||
}
|
||||
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
dialog?.window?.let {
|
||||
BarUtils.hideStatusBarAndSticky(it)
|
||||
it.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
|
||||
dialog?.setOnShowListener { _ ->
|
||||
it.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
|
||||
BarUtils.hideStatusBarAndSticky(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val videoListener = CompoundButton.OnCheckedChangeListener { _, isChecked ->
|
||||
CallerLogger.d(M_BUS_P+TAG, "videoListener$isChecked")
|
||||
if (isChecked) {
|
||||
tab = VIDEOTAB
|
||||
fragmentTag = M1VideoFragment.TAG
|
||||
cb_bp_setting_soft.isChecked = false
|
||||
cb_bp_setting_device.isChecked = false
|
||||
cb_bp_setting_order.isChecked = false
|
||||
initFragment()
|
||||
}else{
|
||||
if(!cb_bp_video_player.isChecked&&
|
||||
!cb_bp_setting_soft.isChecked&&
|
||||
!cb_bp_setting_device.isChecked&&
|
||||
!cb_bp_setting_order.isChecked){
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val settingDevices = CompoundButton.OnCheckedChangeListener { _, isChecked ->
|
||||
CallerLogger.d(M_BUS_P+TAG, "settingDevices$isChecked")
|
||||
if (isChecked) {
|
||||
tab = SETTINGDEVICETAB
|
||||
fragmentTag = M1DeviceFragment.TAG
|
||||
cb_bp_setting_soft.isChecked = false
|
||||
cb_bp_video_player.isChecked = false
|
||||
cb_bp_setting_order.isChecked = false
|
||||
initFragment()
|
||||
}else{
|
||||
if(!cb_bp_video_player.isChecked&&
|
||||
!cb_bp_setting_soft.isChecked&&
|
||||
!cb_bp_setting_device.isChecked&&
|
||||
!cb_bp_setting_order.isChecked){
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val settingSoft = CompoundButton.OnCheckedChangeListener { _, isChecked ->
|
||||
CallerLogger.d(M_BUS_P+TAG, "settingSoft$isChecked")
|
||||
if (isChecked) {
|
||||
tab = SETTINGSOFTTAB
|
||||
fragmentTag = M1SoftFragment.TAG
|
||||
cb_bp_video_player.isChecked = false
|
||||
cb_bp_setting_device.isChecked = false
|
||||
cb_bp_setting_order.isChecked = false
|
||||
initFragment()
|
||||
}else{
|
||||
if(!cb_bp_video_player.isChecked&&
|
||||
!cb_bp_setting_soft.isChecked&&
|
||||
!cb_bp_setting_device.isChecked&&
|
||||
!cb_bp_setting_order.isChecked){
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
private val settingOrder = CompoundButton.OnCheckedChangeListener { _, isChecked ->
|
||||
CallerLogger.d(M_BUS_P+TAG, "settingOrder$isChecked")
|
||||
if (isChecked) {
|
||||
if(isEarlyClose){
|
||||
tab = SETTINGENDORDERTAB
|
||||
}else{
|
||||
tab = SETTINGORDERTAB
|
||||
}
|
||||
fragmentTag = M1OrderFragment.TAG
|
||||
cb_bp_video_player.isChecked = false
|
||||
cb_bp_setting_device.isChecked = false
|
||||
cb_bp_setting_soft.isChecked = false
|
||||
initFragment()
|
||||
}else{
|
||||
if(!cb_bp_video_player.isChecked&&
|
||||
!cb_bp_setting_soft.isChecked&&
|
||||
!cb_bp_setting_device.isChecked&&
|
||||
!cb_bp_setting_order.isChecked){
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
context?.let {
|
||||
SharedPrefs.getInstance(it).putString(SELECTTAB, tab)
|
||||
}
|
||||
}
|
||||
|
||||
override fun createPresenter(): BusPassengerFunctionPresenter =
|
||||
BusPassengerFunctionPresenter(this)
|
||||
|
||||
/**
|
||||
* 重写父类show()方法
|
||||
* 避免出现java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
|
||||
*/
|
||||
override fun show(manager: FragmentManager, tag: String?) {
|
||||
try {
|
||||
var cls = this.javaClass.superclass ?: return
|
||||
while (true) {
|
||||
if (cls.name == "java.lang.Object") {
|
||||
break
|
||||
}
|
||||
cls = cls.superclass!!
|
||||
if (cls == DialogFragment::class.java) {
|
||||
break
|
||||
}
|
||||
}
|
||||
val mDismissed = cls.getDeclaredField("mDismissed")
|
||||
val mShownByMe = cls.getDeclaredField("mShownByMe")
|
||||
mDismissed.isAccessible = true
|
||||
mShownByMe.isAccessible = true
|
||||
mDismissed.setBoolean(this, false)
|
||||
mShownByMe.setBoolean(this, true)
|
||||
if (isAdded) { //解决方法就是添加这行代码,如果已经添加了,就移除掉然后再show,就不会出现Fragment already added的错误了。
|
||||
return
|
||||
}
|
||||
val ft: FragmentTransaction = manager.beginTransaction()
|
||||
ft.add(this, tag)
|
||||
ft.commitAllowingStateLoss()
|
||||
} catch (e: Exception) {
|
||||
Log.e("DialogFragment", "show", e.fillInStackTrace())
|
||||
}
|
||||
}
|
||||
|
||||
override fun onViewStateRestored(savedInstanceState: Bundle?) {
|
||||
CallerLogger.d(M_BUS_P+TAG, "onViewStateRestored")
|
||||
cb_bp_video_player.setOnCheckedChangeListener(null)
|
||||
cb_bp_setting_soft.setOnCheckedChangeListener(null)
|
||||
cb_bp_setting_device.setOnCheckedChangeListener(null)
|
||||
cb_bp_setting_order.setOnCheckedChangeListener(null)
|
||||
cb_bp_video_player.isChecked = false
|
||||
cb_bp_setting_soft.isChecked = false
|
||||
cb_bp_setting_device.isChecked = false
|
||||
cb_bp_setting_order.isChecked = false
|
||||
cb_bp_video_player.setOnCheckedChangeListener(videoListener)
|
||||
cb_bp_setting_soft.setOnCheckedChangeListener(settingSoft)
|
||||
cb_bp_setting_device.setOnCheckedChangeListener(settingDevices)
|
||||
cb_bp_setting_order.setOnCheckedChangeListener(settingOrder)
|
||||
|
||||
when (tab) {
|
||||
VIDEOTAB -> cb_bp_video_player.isChecked = true
|
||||
SETTINGDEVICETAB -> cb_bp_setting_device.isChecked = true
|
||||
SETTINGSOFTTAB -> cb_bp_setting_soft.isChecked = true
|
||||
SETTINGORDERTAB -> cb_bp_setting_order.isChecked = true
|
||||
SETTINGENDORDERTAB -> cb_bp_setting_order.isChecked = true
|
||||
else -> {}
|
||||
}
|
||||
super.onViewStateRestored(savedInstanceState)
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG = "BusPassengerFunctionFragment"
|
||||
|
||||
const val VIDEOTAB = "VideoTab"
|
||||
const val SETTINGSOFTTAB = "SettingSoftTab"
|
||||
const val SETTINGDEVICETAB = "SettingDeviceTab"
|
||||
const val SETTINGORDERTAB = "SettingOrderTab"
|
||||
const val SETTINGENDORDERTAB = "SettingEndOrderTab"
|
||||
|
||||
const val SELECTTAB = "SELECTTAB"
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(): M1ContainFragment {
|
||||
val args = Bundle()
|
||||
val fragment = M1ContainFragment()
|
||||
fragment.arguments = args
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
|
||||
interface ContainDismiss{
|
||||
fun closeDialog()
|
||||
}
|
||||
interface ChangeCheck{
|
||||
fun changeChange()
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerFunctionDevicePresenter
|
||||
import com.mogo.och.common.module.utils.SoundPoolHelper
|
||||
import kotlinx.android.synthetic.m1.m1_devices_fragment.*
|
||||
|
||||
/**
|
||||
* @author: yangyakun
|
||||
* @date: 2023/1/28
|
||||
*/
|
||||
class M1DeviceFragment :
|
||||
MvpFragment<M1DeviceFragment?, BusPassengerFunctionDevicePresenter?>() {
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.m1_devices_fragment
|
||||
|
||||
override fun getTagName(): String = TAG
|
||||
|
||||
override fun initViews() {
|
||||
initListener()
|
||||
}
|
||||
|
||||
private fun initListener() {
|
||||
tv_car_setting_go.setOnClickListener {
|
||||
//判断自动驾驶状态
|
||||
// 自动驾驶状态中: AdasManager.getInstance().sendPlanningCmd(2);
|
||||
// 没有在自动驾驶中:启动自动驾驶 CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
|
||||
mPresenter?.startGo()
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di)
|
||||
}
|
||||
tv_car_setting_stopside.setOnClickListener {
|
||||
// 执行靠边停车 AdasManager.getInstance().sendPlanningCmd(1);
|
||||
mPresenter?.startStopSide()
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di)
|
||||
}
|
||||
tv_car_setting_opendoor.onClick {
|
||||
// 开门 AdasManager.getInstance().sendRoboBusJinlvM1FrontDoorCmd(2);
|
||||
mPresenter?.openDoor()
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di)
|
||||
}
|
||||
tv_car_setting_closedoor.onClick {
|
||||
mPresenter?.closeDoor()
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.bus_di)
|
||||
}
|
||||
}
|
||||
|
||||
override fun createPresenter(): BusPassengerFunctionDevicePresenter =
|
||||
BusPassengerFunctionDevicePresenter(this)
|
||||
|
||||
companion object {
|
||||
const val TAG = "BusPassengerFunctionDeviceFragment"
|
||||
@JvmStatic
|
||||
fun newInstance(): M1DeviceFragment {
|
||||
val args = Bundle()
|
||||
val fragment = M1DeviceFragment()
|
||||
fragment.arguments = args
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerFunctionEarlyEndOrderPresenter
|
||||
import kotlinx.android.synthetic.m1.m1_order_early_end.*
|
||||
|
||||
/**
|
||||
* @author: yangyakun
|
||||
* @date: 2023/1/28
|
||||
*/
|
||||
class M1EarlyEndOrderFragment :
|
||||
MvpFragment<M1EarlyEndOrderFragment?, BusPassengerFunctionEarlyEndOrderPresenter?>() {
|
||||
|
||||
private var dismiss: M1ContainFragment.ContainDismiss?=null
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.m1_order_early_end
|
||||
}
|
||||
|
||||
override fun getTagName(): String {
|
||||
return TAG
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
tv_early_end_cancle.onClick {
|
||||
closeDialogContaion()
|
||||
}
|
||||
tv_early_end_submit.onClick {
|
||||
mPresenter?.endOrder()
|
||||
}
|
||||
}
|
||||
|
||||
fun closeDialogContaion(){
|
||||
this.dismiss?.closeDialog()
|
||||
}
|
||||
|
||||
override fun createPresenter(): BusPassengerFunctionEarlyEndOrderPresenter {
|
||||
return BusPassengerFunctionEarlyEndOrderPresenter(this)
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
const val TAG = "BusPassengerFunctionOrderFragment"
|
||||
@JvmStatic
|
||||
fun newInstance(dismiss: M1ContainFragment.ContainDismiss): M1EarlyEndOrderFragment {
|
||||
val args = Bundle()
|
||||
val fragment = M1EarlyEndOrderFragment()
|
||||
fragment.arguments = args
|
||||
fragment.setContainDismiss(dismiss)
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
private fun setContainDismiss(dismiss: M1ContainFragment.ContainDismiss) {
|
||||
this.dismiss = dismiss
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.TaxiPassengerVideoPlay
|
||||
import com.mogo.och.bus.passenger.model.OrderStatusEnum
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerFunctionOrderPresenter
|
||||
import kotlinx.android.synthetic.m1.m1_order_fragment.*
|
||||
|
||||
/**
|
||||
* @author: yangyakun
|
||||
* @date: 2023/1/28
|
||||
*/
|
||||
class M1OrderFragment :
|
||||
MvpFragment<M1OrderFragment?, BusPassengerFunctionOrderPresenter?>() {
|
||||
|
||||
private var changeCheck: M1ContainFragment.ChangeCheck?=null
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.m1_order_fragment
|
||||
}
|
||||
|
||||
override fun getTagName(): String {
|
||||
return TAG
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
lsv_line_site.setchangeCheck(this.changeCheck)
|
||||
}
|
||||
|
||||
fun setViewByOrderStatus(currentStatus: OrderStatusEnum){
|
||||
when (currentStatus) {
|
||||
OrderStatusEnum.NoOrderUnuse -> {
|
||||
// 无订单页面
|
||||
m1_order_noorder.visibility = View.VISIBLE
|
||||
m1_order_early_end.visibility = View.GONE
|
||||
lsv_line_site.visibility = View.GONE
|
||||
}
|
||||
OrderStatusEnum.OrderNoLine -> {
|
||||
// 选择线路页面
|
||||
m1_order_noorder.visibility = View.GONE
|
||||
m1_order_early_end.visibility = View.GONE
|
||||
lsv_line_site.visibility = View.VISIBLE
|
||||
}
|
||||
OrderStatusEnum.OrdersWithLine -> {
|
||||
// 选择线路页面
|
||||
m1_order_noorder.visibility = View.GONE
|
||||
m1_order_early_end.visibility = View.GONE
|
||||
lsv_line_site.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun createPresenter(): BusPassengerFunctionOrderPresenter {
|
||||
return BusPassengerFunctionOrderPresenter(this)
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
const val TAG = "BusPassengerFunctionOrderFragment"
|
||||
@JvmStatic
|
||||
fun newInstance(changeCheck: M1ContainFragment.ChangeCheck): M1OrderFragment {
|
||||
val args = Bundle()
|
||||
val fragment = M1OrderFragment()
|
||||
fragment.arguments = args
|
||||
fragment.changeCheck = changeCheck
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,260 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.graphics.BitmapFactory
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxButtonView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
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.AppStateManager
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.common.module.voice.VoiceManager
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerPresenter
|
||||
import com.mogo.och.bus.passenger.utils.VoiceFocusManager
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager
|
||||
import kotlinx.android.synthetic.m1.m1_main_fragment.*
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/4/12
|
||||
*/
|
||||
class MainFragment :
|
||||
MvpFragment<MainFragment?, BusPassengerPresenter?>() {
|
||||
|
||||
private var bpFunctionGroupDialogFragment: WeakReference<M1ContainFragment>? = null
|
||||
private var m1CarUserNoOrderFragment: WeakReference<M1CarUserNoOrderFragment>? = null
|
||||
|
||||
val endStation =
|
||||
BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.m1_small_map_view_dir_end)
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.m1_main_fragment
|
||||
}
|
||||
|
||||
override fun getTagName(): String {
|
||||
return TAG
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
cb_bp_video_player.onClick {
|
||||
openSettingPage(M1ContainFragment.VIDEOTAB)
|
||||
}
|
||||
cb_bp_setting_soft.onClick {
|
||||
openSettingPage(M1ContainFragment.SETTINGSOFTTAB)
|
||||
}
|
||||
cb_bp_setting_device.onClick {
|
||||
openSettingPage(M1ContainFragment.SETTINGDEVICETAB)
|
||||
}
|
||||
cb_bp_setting_order.onClick {
|
||||
if (LoginStatusManager.isLogin()) {
|
||||
openSettingPage(M1ContainFragment.SETTINGORDERTAB)
|
||||
}else{
|
||||
ToastUtils.showShort(AbsMogoApplication.getApp().getString(R.string.m1_please_login_driver))
|
||||
}
|
||||
}
|
||||
iv_end_order.onClick {
|
||||
if (LoginStatusManager.isLogin()) {
|
||||
if(mPresenter?.haveOrder()==true){
|
||||
openSettingPage(M1ContainFragment.SETTINGENDORDERTAB)
|
||||
}else{
|
||||
ToastUtils.showShort("没有订单无法结束订单")
|
||||
}
|
||||
}else{
|
||||
ToastUtils.showShort(AbsMogoApplication.getApp().getString(R.string.m1_please_login_driver))
|
||||
}
|
||||
}
|
||||
|
||||
viewBusPM1MsgBoxButton.setClickListener(object : MMsgBoxButtonView.ClickListener {
|
||||
override fun showMsgBoxList(show: Boolean) {
|
||||
if (show) {
|
||||
viewBusPM1MsgBoxList.visibility = View.VISIBLE
|
||||
viewBusPM1MsgBoxBubble.visibility = View.GONE
|
||||
viewBusPM1MsgBoxBubble.isShowData(false)
|
||||
} else {
|
||||
viewBusPM1MsgBoxList.visibility = View.GONE
|
||||
viewBusPM1MsgBoxBubble.visibility = View.VISIBLE
|
||||
viewBusPM1MsgBoxBubble.isShowData(true)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
private fun openSettingPage(tab: String) {
|
||||
val fragmentByTag: Fragment? = childFragmentManager.findFragmentByTag(M1ContainFragment.TAG)
|
||||
if (fragmentByTag is DialogFragment) {
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.dialog!!.isShowing) {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "正在展示")
|
||||
return
|
||||
}
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.isAdded) {
|
||||
if (AppStateManager.currentActivity() == null) { // 没有在当前应用内 在启动页面关闭应用
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "权限验证")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bpFunctionGroupDialogFragment?.get() == null) {
|
||||
bpFunctionGroupDialogFragment = WeakReference(M1ContainFragment.newInstance())
|
||||
}
|
||||
val bpFunctionGroup = bpFunctionGroupDialogFragment?.get()
|
||||
bpFunctionGroup?.arguments?.putString(M1ContainFragment.SELECTTAB, tab)
|
||||
if (bpFunctionGroup != null) {
|
||||
if (bpFunctionGroup.dialog != null && bpFunctionGroup.dialog!!.isShowing) {
|
||||
return
|
||||
}
|
||||
if (bpFunctionGroup.isAdded) { //解决方法就是添加这行代码,如果已经添加了,就移除掉然后再show,就不会出现Fragment already added的错误了。
|
||||
parentFragmentManager.beginTransaction().remove(bpFunctionGroup)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
if (ClickUtils.isFastClick()) {
|
||||
bpFunctionGroup.show(parentFragmentManager, TAG)
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "展示$tab")
|
||||
} else {
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_BUS_P + TAG, "dialog 1s内执行一次"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun setSpeed(speed: String) {
|
||||
tv_speed.text = speed
|
||||
}
|
||||
|
||||
fun setDistanceAndTime(
|
||||
distance: String,
|
||||
distanceUnit: String,
|
||||
) {
|
||||
tv_distance.text = distance
|
||||
tv_distance_unit.text = "距离(${distanceUnit})"
|
||||
}
|
||||
fun setOrderTime(
|
||||
sumTime: String,
|
||||
arrivedTime: String
|
||||
) {
|
||||
tv_distance_surplus_time.text = sumTime
|
||||
tv_distance_arrive_time.text = arrivedTime
|
||||
}
|
||||
|
||||
fun setCarModle(rawInfo: Int){
|
||||
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(rawInfo)
|
||||
HdMapBuildConfig.currentCarVrIconRes = rawInfo
|
||||
}
|
||||
|
||||
override fun createPresenter(): BusPassengerPresenter {
|
||||
return BusPassengerPresenter(this)
|
||||
}
|
||||
|
||||
override fun initViews(savedInstanceState: Bundle?) {
|
||||
super.initViews(savedInstanceState)
|
||||
mapBizView.onCreate(savedInstanceState)
|
||||
omvOverMap.onCreateView(savedInstanceState)
|
||||
}
|
||||
|
||||
fun drawEndStation(latLng: LatLng) {
|
||||
val listOf = listOf(latLng)
|
||||
omvOverMap.drawSiteMarkers(listOf,endStation,0.5f,0.5f)
|
||||
}
|
||||
fun cleanEndStation(){
|
||||
omvOverMap.clearSiteMarkers()
|
||||
omvOverMap.clearCustomPolyline()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
mapBizView.onResume()
|
||||
omvOverMap.onResume()
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
mapBizView.onSaveInstanceState(outState)
|
||||
}
|
||||
|
||||
override fun onLowMemory() {
|
||||
super.onLowMemory()
|
||||
mapBizView.onLowMemory()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
mapBizView.onPause()
|
||||
omvOverMap.onPause()
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
mapBizView.onDestroy()
|
||||
omvOverMap.onDestroy()
|
||||
super.onDestroyView()
|
||||
}
|
||||
|
||||
fun showOpenAndCloseDoor() {
|
||||
val bpFunctionGroup = bpFunctionGroupDialogFragment?.get()
|
||||
bpFunctionGroup?.dismissAllowingStateLoss()
|
||||
val fragmentByTag: Fragment? = childFragmentManager.findFragmentByTag(M1ContainFragment.TAG)
|
||||
if (fragmentByTag is DialogFragment) {
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.dialog!!.isShowing) {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "正在展示")
|
||||
return
|
||||
}
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.isAdded) {
|
||||
if (AppStateManager.currentActivity() == null) { // 没有在当前应用内 在启动页面关闭应用
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "权限验证")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m1CarUserNoOrderFragment?.get() == null) {
|
||||
m1CarUserNoOrderFragment = WeakReference(M1CarUserNoOrderFragment.newInstance())
|
||||
}
|
||||
val m1CarUserNoOrderFragment = m1CarUserNoOrderFragment?.get()
|
||||
if (m1CarUserNoOrderFragment != null) {
|
||||
if (m1CarUserNoOrderFragment.dialog != null && m1CarUserNoOrderFragment.dialog!!.isShowing) {
|
||||
return
|
||||
}
|
||||
if (m1CarUserNoOrderFragment.isAdded) { //解决方法就是添加这行代码,如果已经添加了,就移除掉然后再show,就不会出现Fragment already added的错误了。
|
||||
parentFragmentManager.beginTransaction().remove(m1CarUserNoOrderFragment)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
if (ClickUtils.isFastClick()) {
|
||||
m1CarUserNoOrderFragment.show(parentFragmentManager, TAG)
|
||||
VoiceManager.endOrder()
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "展示开关门")
|
||||
} else {
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_BUS_P + TAG, "dialog 1s内执行一次"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
fun closeOpenAndCloseDoor(){
|
||||
val bpFunctionGroup = m1CarUserNoOrderFragment?.get()
|
||||
bpFunctionGroup?.let {
|
||||
bpFunctionGroup.dismissAllowingStateLoss()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
public const val TAG = "BusPassengerRouteFragment"
|
||||
}
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.ui.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
|
||||
|
||||
/**
|
||||
* Created by adityagohad on 06/06/17.
|
||||
*/
|
||||
class OrderSiteItemAdapter(private val context: Context, private val dataList: MutableList<SiteInfoResponse.SiteInfo>) : RecyclerView.Adapter<OrderSiteItemAdapter.TextVH>() {
|
||||
|
||||
private var enableIndex = -1
|
||||
private var enable = true
|
||||
|
||||
var checkChangeListener:CheckListener?=null
|
||||
|
||||
|
||||
fun setDataList(dataList: List<SiteInfoResponse.SiteInfo>){
|
||||
this.dataList.clear()
|
||||
this.dataList.addAll(dataList)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
fun setEnableIndex(enableIndex:Int){
|
||||
this.enableIndex = enableIndex
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
fun setEnable(enable:Boolean){
|
||||
this.enable = enable
|
||||
// dataList.forEachIndexed { _, lineInfo ->
|
||||
// lineInfo.isCheck = false
|
||||
// }
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TextVH {
|
||||
val view: View
|
||||
val inflater = LayoutInflater.from(context)
|
||||
view = inflater.inflate(R.layout.m1_order_site_item, parent, false)
|
||||
return TextVH(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: TextVH, position: Int) {
|
||||
val siteInfo = dataList[holder.bindingAdapterPosition]
|
||||
if(holder.bindingAdapterPosition>enableIndex){
|
||||
if(siteInfo.isCheck){
|
||||
holder.iv_site_checked.setImageResource(R.drawable.m1_order_site_checked)
|
||||
}else{
|
||||
holder.iv_site_checked.setImageResource(R.drawable.m1_order_site_check)
|
||||
}
|
||||
holder.tv_site_site_name.setTextColor(ContextCompat.getColor(context,R.color.bus_p_m1_222222))
|
||||
}else {
|
||||
holder.iv_site_checked.setImageResource(R.drawable.m1_order_site_check_enable)
|
||||
holder.tv_site_site_name.setTextColor(ContextCompat.getColor(context,R.color.bus_p_m1_332C2D31))
|
||||
}
|
||||
holder.tv_site_site_name.text = siteInfo.siteName
|
||||
holder.itemView.setOnClickListener {
|
||||
if(enable) {
|
||||
if (holder.bindingAdapterPosition > enableIndex) {
|
||||
dataList.forEachIndexed { index, lineInfo ->
|
||||
lineInfo.isCheck = index==position
|
||||
}
|
||||
notifyDataSetChanged()
|
||||
checkChangeListener?.onCheckListener(siteInfo)
|
||||
} else {
|
||||
if (siteInfo.isNear) {
|
||||
ToastUtils.showShort("您已在此站点附近")
|
||||
} else {
|
||||
ToastUtils.showShort("站点已过,请选择返程路线")
|
||||
}
|
||||
}
|
||||
}else{
|
||||
ToastUtils.showShort("请确认线路")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return dataList.size
|
||||
}
|
||||
|
||||
fun clearCheck() {
|
||||
dataList.forEachIndexed { index, lineInfo ->
|
||||
lineInfo.isCheck = false
|
||||
}
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
interface CheckListener{
|
||||
fun onCheckListener(siteInfo:SiteInfoResponse.SiteInfo)
|
||||
}
|
||||
|
||||
inner class TextVH(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var tv_site_site_name: TextView
|
||||
var iv_site_checked: ImageView
|
||||
|
||||
init {
|
||||
tv_site_site_name = itemView.findViewById(R.id.tv_site_site_name)
|
||||
iv_site_checked = itemView.findViewById(R.id.iv_site_checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.ui.view
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.BlueToothView
|
||||
import com.mogo.och.bus.passenger.R
|
||||
|
||||
class EarlyEndOrderView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.m1_order_early_end, this, true)
|
||||
}
|
||||
}
|
||||
@@ -1,564 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.ui.view
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.LinearInterpolator
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.LoopInfo
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoListResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.net.BusPassengerModelLoopManager
|
||||
import com.mogo.och.bus.passenger.net.BusPassengerServiceManager
|
||||
import com.mogo.och.bus.passenger.ui.M1ContainFragment
|
||||
import com.mogo.och.bus.passenger.ui.adapter.OrderLineItemAdapter
|
||||
import com.mogo.och.bus.passenger.ui.adapter.OrderSiteItemAdapter
|
||||
import com.mogo.och.bus.passenger.utils.RxUtils
|
||||
import com.mogo.och.bus.passenger.view.BottomDecoration
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPMsgType
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.OCHPlanningStopSideStatusManager
|
||||
import com.mogo.och.common.module.bean.dpmsg.ChangeDestMsg
|
||||
import io.reactivex.disposables.Disposable
|
||||
import kotlinx.android.synthetic.m1.m1_order_lineside.view.*
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
class LineSiteView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
companion object {
|
||||
const val TAG = "LineSiteView"
|
||||
const val TAGLINELOOP = "LineSiteViewLineLoop"
|
||||
}
|
||||
|
||||
// 成功提交给后台得线路
|
||||
private var checkLine: LineInfoResponse.LineInfo? = null
|
||||
|
||||
// 成功提交给后台得终点站点
|
||||
private var checkSite: SiteInfoResponse.SiteInfo? = null
|
||||
|
||||
// 下一个站点
|
||||
private var currentSite: SiteInfoResponse.SiteInfo? = null
|
||||
|
||||
// 向司机端端提交的临时线路
|
||||
private var tempCheckLine: LineInfoResponse.LineInfo? = null
|
||||
|
||||
// 向司机端临时提交的终点站点
|
||||
private var tempCheckSite: SiteInfoResponse.SiteInfo? = null
|
||||
|
||||
private var tempCheckLineIsSubmit = false
|
||||
private var isChangeIngLineAndSite = false
|
||||
|
||||
|
||||
private val lineList = mutableListOf<LineInfoResponse.LineInfo>()
|
||||
private val siteList = mutableListOf<SiteInfoResponse.SiteInfo>()
|
||||
|
||||
private var lineAdapter: OrderLineItemAdapter
|
||||
private var siteAdapter: OrderSiteItemAdapter
|
||||
|
||||
private var gnssSpeed = 0.0
|
||||
|
||||
private val loadingAni =
|
||||
ObjectAnimator.ofFloat(iv_loading_wait_driver, "rotation", 0f, 90f, 180f, 270f, 360f)
|
||||
.apply {
|
||||
repeatCount = -1
|
||||
interpolator = LinearInterpolator()
|
||||
duration = 1000
|
||||
}
|
||||
private var changeCheck: M1ContainFragment.ChangeCheck?=null
|
||||
private var subscribeSelectLine: Disposable? = null
|
||||
private var subscribeSelectSite: Disposable? = null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.m1_order_lineside, this, true)
|
||||
lineAdapter = OrderLineItemAdapter(context, lineList)
|
||||
siteAdapter = OrderSiteItemAdapter(context, siteList)
|
||||
loadingAni.target = iv_loading_wait_driver
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
rlv_line_list.layoutManager =
|
||||
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||
rlv_line_list.addItemDecoration(BottomDecoration(AutoSizeUtils.dp2px(context, 60f)))
|
||||
rlv_line_list.adapter = lineAdapter
|
||||
|
||||
rv_site_list.layoutManager =
|
||||
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||
rv_site_list.addItemDecoration(BottomDecoration(AutoSizeUtils.dp2px(context, 60f)))
|
||||
rv_site_list.adapter = siteAdapter
|
||||
|
||||
val hasSetLineAndSite = CharterPassengerModel.hasSetLineAndSite()
|
||||
if (hasSetLineAndSite != null) {// 已经设置了线路和站点
|
||||
checkLine = hasSetLineAndSite.first
|
||||
checkSite = hasSetLineAndSite.second
|
||||
lineList.clear()
|
||||
resetData()
|
||||
} else {
|
||||
queryLineList()
|
||||
setEnableLineStatus(true)
|
||||
setEnableSiteStatus(false)
|
||||
onlyChangeSite(false)
|
||||
setSiteAdapterEnable(false)
|
||||
setSwitchEnable(false)
|
||||
isChangeIngLineAndSite = false
|
||||
}
|
||||
|
||||
initListener()
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置数据
|
||||
*/
|
||||
private fun resetData() {
|
||||
if(checkLine==null){// 没有提交线路
|
||||
queryLineList()
|
||||
setEnableLineStatus(true)
|
||||
setEnableSiteStatus(false)
|
||||
onlyChangeSite(false)
|
||||
setSiteAdapterEnable(false)
|
||||
}else{
|
||||
checkLine?.let {
|
||||
setEnableLineStatus(false)
|
||||
setEnableSiteStatus(false)
|
||||
onlyChangeSite(false)
|
||||
setSiteAdapterEnable(true)
|
||||
isChangeIngLineAndSite = true
|
||||
lineAdapter.submitLine(it)
|
||||
checkLine?.let {
|
||||
querySitesByLineId(it.lineId.toString(),false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否可用进行选择线路
|
||||
*/
|
||||
private fun setEnableLineStatus(enable: Boolean) {
|
||||
if (enable) {
|
||||
g_line_submit_group.visibility = View.VISIBLE
|
||||
lineAdapter.setEnable(true)
|
||||
} else {
|
||||
g_line_submit_group.visibility = View.GONE
|
||||
lineAdapter.setEnable(false)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否可用选择站点
|
||||
*/
|
||||
private fun setEnableSiteStatus(cancleAndSubmit: Boolean) {
|
||||
if (cancleAndSubmit) {
|
||||
g_side_cancle_submit_group.visibility = View.VISIBLE
|
||||
} else {
|
||||
g_side_cancle_submit_group.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
fun onlyChangeSite(submit:Boolean){
|
||||
if (submit) {
|
||||
g_side_submit_group.visibility = View.VISIBLE
|
||||
} else {
|
||||
g_side_submit_group.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
fun setSiteAdapterEnable(enable: Boolean){
|
||||
if(enable){
|
||||
siteAdapter.setEnable(true)
|
||||
}else{
|
||||
siteAdapter.setEnable(false)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initListener() {
|
||||
lineAdapter.checkChangeListener = object : OrderLineItemAdapter.CheckListener {
|
||||
override fun onCheckListener(lineInfo: LineInfoResponse.LineInfo) {
|
||||
tempCheckLine = lineInfo
|
||||
querySitesByLineId(lineInfo.lineId.toString(),true)
|
||||
siteAdapter.clearCheck()
|
||||
}
|
||||
}
|
||||
siteAdapter.checkChangeListener = object : OrderSiteItemAdapter.CheckListener {
|
||||
override fun onCheckListener(siteInfo: SiteInfoResponse.SiteInfo) {
|
||||
// 设置临时选中的
|
||||
tempCheckSite = siteInfo
|
||||
if(isChangeIngLineAndSite) {
|
||||
checkSite?.let {
|
||||
if (it.siteId == siteInfo.siteId) {
|
||||
onlyChangeSite(false)
|
||||
} else {
|
||||
onlyChangeSite(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
tv_line_cancle.onClick {
|
||||
resetData()
|
||||
tempCheckLine = null
|
||||
}
|
||||
tv_site_cancle.onClick {
|
||||
resetData()
|
||||
tempCheckLine = null
|
||||
tempCheckSite = null
|
||||
}
|
||||
tv_line_submit.onClick {
|
||||
if (tempCheckLine == null) {
|
||||
ToastUtils.showLong("请选择线路")
|
||||
return@onClick
|
||||
}
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastUtils.showLong("乘客屏无法连接司机屏请联系安全员")
|
||||
return@onClick
|
||||
}
|
||||
tempCheckLine?.let {
|
||||
val msg = ChangeDestMsg(
|
||||
it.lineId!!.toInt(),
|
||||
it.name!!,
|
||||
0,
|
||||
"",
|
||||
0,
|
||||
"",
|
||||
false
|
||||
)
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
startAni()
|
||||
// 启动查看和司机端链接
|
||||
BusPassengerModelLoopManager.setLoopFunction(
|
||||
TAGLINELOOP,
|
||||
LoopInfo(3, ::checkServerStatus)
|
||||
)
|
||||
RxUtils.disposeSubscribe(subscribeSelectLine)
|
||||
subscribeSelectLine= RxUtils.createSubscribe(120_000){
|
||||
ToastUtils.showShort("请联系安全员确认")
|
||||
endAni()
|
||||
}
|
||||
}
|
||||
}
|
||||
tv_site_submit.onClick {
|
||||
if (!tempCheckLineIsSubmit) {
|
||||
ToastUtils.showLong("请选择站点")
|
||||
return@onClick
|
||||
}
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastUtils.showLong("乘客屏无法连接司机屏请联系安全员")
|
||||
return@onClick
|
||||
}
|
||||
tempCheckSite?.let { lineInfo ->
|
||||
tempCheckSite?.let { siteInfo ->
|
||||
val msg = ChangeDestMsg(
|
||||
lineInfo.lineId!!.toInt(),
|
||||
lineInfo.lineName!!,
|
||||
currentSite!!.siteId!!.toInt(),
|
||||
currentSite!!.siteName!!,
|
||||
siteInfo.siteId!!.toInt(),
|
||||
siteInfo.siteName!!,
|
||||
false
|
||||
)
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
}
|
||||
startAni()
|
||||
// 启动查看和司机端链接
|
||||
BusPassengerModelLoopManager.setLoopFunction(
|
||||
TAGLINELOOP,
|
||||
LoopInfo(3, ::checkServerStatus)
|
||||
)
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
subscribeSelectSite = RxUtils.createSubscribe(120_000){
|
||||
ToastUtils.showShort("请联系安全员确认")
|
||||
endAni()
|
||||
}
|
||||
}
|
||||
}
|
||||
tv_site_only_submit.onClick {
|
||||
// 线路不换只换站点
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastUtils.showLong("乘客屏无法连接司机屏请联系安全员")
|
||||
return@onClick
|
||||
}
|
||||
tempCheckSite?.let { siteInfo ->
|
||||
val msg = ChangeDestMsg(
|
||||
siteInfo.lineId!!.toInt(),
|
||||
siteInfo.lineName!!,
|
||||
currentSite!!.siteId!!.toInt(),
|
||||
currentSite!!.siteName!!,
|
||||
siteInfo.siteId!!.toInt(),
|
||||
siteInfo.siteName!!,
|
||||
false
|
||||
)
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
}
|
||||
startAni()
|
||||
// 启动查看和司机端链接
|
||||
BusPassengerModelLoopManager.setLoopFunction(
|
||||
TAGLINELOOP,
|
||||
LoopInfo(3, ::checkServerStatus)
|
||||
)
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
subscribeSelectSite = RxUtils.createSubscribe(120_000){
|
||||
ToastUtils.showShort("请联系安全员确认")
|
||||
endAni()
|
||||
}
|
||||
}
|
||||
tv_loading_wait_driver_title.onClick {
|
||||
endAni()
|
||||
}
|
||||
|
||||
CallerTelematicListenerManager.addListener(TAG, msgReceived)
|
||||
CharterPassengerModel.setControllerStatusCallback(TAG) { location ->
|
||||
location?.let {
|
||||
gnssSpeed = it.gnssInfo.vehicleSpeed
|
||||
}
|
||||
}
|
||||
tv_switch_line.onClick {
|
||||
if (gnssSpeed < 0.5) {
|
||||
// TODO: 自驾中 需要 靠边停车中、到站
|
||||
// TODO: 没有自驾中 需要 靠边停车中、到站
|
||||
when (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
|
||||
// 可以切换路径
|
||||
isChangeIngLineAndSite = false
|
||||
onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
setEnableLineStatus(true)
|
||||
setSiteAdapterEnable(false)
|
||||
queryLineList()
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
|
||||
isChangeIngLineAndSite = false
|
||||
onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
setEnableLineStatus(true)
|
||||
setSiteAdapterEnable(false)
|
||||
queryLineList()
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
// 自动驾驶中
|
||||
when (OCHPlanningStopSideStatusManager.stopSiteStatus) {
|
||||
OCHPlanningStopSideStatusManager.Status.EndingSuccess -> {
|
||||
isChangeIngLineAndSite = false
|
||||
onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
setEnableLineStatus(true)
|
||||
setSiteAdapterEnable(false)
|
||||
queryLineList()
|
||||
}
|
||||
else ->{
|
||||
ToastUtils.showShort("自动驾驶中无法切换线路")
|
||||
}
|
||||
}
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
|
||||
ToastUtils.showShort("因车辆正在平行驾驶中无法切换线路")
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showShort("请停车后再修改目的地~")
|
||||
}
|
||||
}
|
||||
}
|
||||
private fun setSwitchEnable(enable: Boolean){
|
||||
tv_switch_line.isEnabled = enable
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收司机屏反馈信息
|
||||
*/
|
||||
val msgReceived = object : IReceivedMsgListener {
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
UiThreadHandler.post {
|
||||
if (type == OchCommonConst.BUSINESS_STRING) {
|
||||
val msg = GsonUtils.fromJson(
|
||||
String(byteArray),
|
||||
ChangeDestMsg::class.java
|
||||
) as ChangeDestMsg
|
||||
if (msg.type == DPMsgType.TYPE_CHANGE_DEST.type) {
|
||||
if (msg.destSiteId == 0) {
|
||||
if (msg.isConfirmed) {
|
||||
ToastUtils.showShort("线路确定")
|
||||
setEnableLineStatus(false)
|
||||
setEnableSiteStatus(true)
|
||||
onlyChangeSite(false)
|
||||
setSiteAdapterEnable(true)
|
||||
setSwitchEnable(false)
|
||||
tempCheckLineIsSubmit = true
|
||||
tempCheckLine?.let {
|
||||
lineAdapter.submitLine(it)
|
||||
}
|
||||
} else {
|
||||
tempCheckLineIsSubmit = false
|
||||
ToastUtils.showShort("司机端拒绝请重新选择")
|
||||
}
|
||||
RxUtils.disposeSubscribe(subscribeSelectLine)
|
||||
} else {
|
||||
if (msg.isConfirmed) {
|
||||
ToastUtils.showShort("站点确定")
|
||||
setEnableLineStatus(false)
|
||||
setEnableSiteStatus(true)
|
||||
onlyChangeSite(false)
|
||||
setSiteAdapterEnable(true)
|
||||
setSwitchEnable(true)
|
||||
checkLine = tempCheckLine
|
||||
checkSite = tempCheckSite
|
||||
tempCheckLine = null
|
||||
tempCheckSite = null
|
||||
tempCheckLineIsSubmit = false
|
||||
checkLine?.let {
|
||||
lineAdapter.submitLine(it)
|
||||
}
|
||||
go2StartCar()
|
||||
CharterPassengerModel.queryOrder()
|
||||
CharterPassengerModel.cleanbroadcastListInfo()
|
||||
} else {
|
||||
tempCheckLineIsSubmit = true
|
||||
ToastUtils.showShort("司机端拒绝请重新选择")
|
||||
}
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
}
|
||||
BusPassengerModelLoopManager.removeLoopFunction(TAGLINELOOP)
|
||||
endAni()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun go2StartCar() {
|
||||
changeCheck?.changeChange()
|
||||
}
|
||||
|
||||
fun setchangeCheck(changeCheck: M1ContainFragment.ChangeCheck?){
|
||||
this.changeCheck = changeCheck
|
||||
}
|
||||
|
||||
private fun startAni() {
|
||||
g_lines_sites_data.visibility = View.GONE
|
||||
g_loading_group.visibility = View.VISIBLE
|
||||
if (!loadingAni.isRunning) {
|
||||
loadingAni.start()
|
||||
}
|
||||
}
|
||||
|
||||
private fun endAni() {
|
||||
UiThreadHandler.post {
|
||||
g_lines_sites_data.visibility = View.VISIBLE
|
||||
g_loading_group.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
loadingAni.cancel()
|
||||
RxUtils.disposeSubscribe(subscribeSelectLine)
|
||||
RxUtils.disposeSubscribe(subscribeSelectSite)
|
||||
CallerTelematicListenerManager.removeListener(TAG)
|
||||
BusPassengerModelLoopManager.removeLoopFunction(TAGLINELOOP)
|
||||
CharterPassengerModel.setControllerStatusCallback(TAG, null)
|
||||
|
||||
}
|
||||
|
||||
private fun queryLineList() {
|
||||
BusPassengerServiceManager.queryLineList(context, object :
|
||||
OchCommonServiceCallback<LineInfoListResponse> {
|
||||
override fun onSuccess(data: LineInfoListResponse?) {
|
||||
if (data?.data == null) return
|
||||
lineAdapter.setDataList(data.data)
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
ToastUtils.showShort("查询线路失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun checkServerStatus() {
|
||||
if (!CallerTelematicManager.getClientConnStatus()) {
|
||||
ToastUtils.showShort("断开和司机端连接、请联系安全员")
|
||||
BusPassengerModelLoopManager.removeLoopFunction(TAGLINELOOP)
|
||||
endAni()
|
||||
}
|
||||
}
|
||||
|
||||
private fun querySitesByLineId(lineId: String,isSelect:Boolean) {
|
||||
BusPassengerServiceManager.queryLineSiteList(
|
||||
context,
|
||||
lineId,
|
||||
object : OchCommonServiceCallback<SiteInfoResponse> {
|
||||
override fun onSuccess(data: SiteInfoResponse?) {
|
||||
if (data?.data == null) return
|
||||
siteAdapter.setDataList(data.data)
|
||||
if (data.data.isNotEmpty()) {
|
||||
// 计算当前站点是那个
|
||||
val calculateCurrentSite =
|
||||
CharterPassengerModel.calculateCurrentSite(data.data)
|
||||
val first = calculateCurrentSite.first// 可用站点
|
||||
if(first<0){
|
||||
// 所有站点不可用
|
||||
currentSite = data.data[data.data.size-1]
|
||||
currentSite!!.isNear = calculateCurrentSite.second
|
||||
siteAdapter.setEnableIndex(data.data.size-1)
|
||||
}else{
|
||||
//
|
||||
val index = if(first==0) {
|
||||
0
|
||||
}else if (first <= data.data.size-1) {
|
||||
first-1
|
||||
} else {
|
||||
data.data.size - 1
|
||||
}
|
||||
currentSite = data.data[index]
|
||||
currentSite!!.isNear = calculateCurrentSite.second
|
||||
siteAdapter.setEnableIndex(index)
|
||||
}
|
||||
if(isSelect){
|
||||
data.data.last().isCheck = true
|
||||
tempCheckSite = data.data.last()
|
||||
}else{
|
||||
data.data.forEach {
|
||||
if (it.siteId == checkSite?.siteId) {
|
||||
it.isCheck = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
ToastUtils.showShort("查询站点失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 808 KiB |