[2.15.0_merge_3.2.0]
@@ -45,10 +45,6 @@ public class MogoOCHBusPassenger implements IMogoOCH {
|
||||
this.mActivity = activity;
|
||||
this.mContainerId = containerId;
|
||||
showFragment();
|
||||
|
||||
if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
|
||||
MultiDisplayUtils.INSTANCE.startActWithSecond(activity, VideoPlayerActivity.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
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.view.LayoutInflater;
|
||||
@@ -19,10 +23,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
|
||||
@@ -58,7 +58,7 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
viewHolder.curArrowBg.setVisibility(View.GONE);
|
||||
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.stationCircle.setImageResource(R.drawable.bus_p_arrive_line_green);
|
||||
BlinkAnimationUtil.setAnimation(viewHolder.stationCircle);
|
||||
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
||||
}else {
|
||||
@@ -79,26 +79,26 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
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.curArrowBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_A9B6CA));
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_gray);
|
||||
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.END);
|
||||
} 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.stationCircle.setImageResource(R.drawable.bus_p_arrive_line_green);
|
||||
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_station_txt_color));
|
||||
viewHolder.curArrowBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_A9B6CA));
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_arrive_line_blue);
|
||||
// BlinkAnimationUtil.setAnimation(viewHolder.stationCircle);
|
||||
// viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
||||
}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.curArrowBg.setBackgroundColor(mContext.getColor(R.color.bus_p_clock_1F82FB));
|
||||
viewHolder.stationCircle.setImageResource(R.drawable.bus_p_point_blue);
|
||||
viewHolder.stationName.setEllipsize(TextUtils.TruncateAt.END);
|
||||
}
|
||||
@@ -110,6 +110,7 @@ public class BusPassengerLineStationsAdapter extends RecyclerView.Adapter<Recycl
|
||||
return mStations.size();
|
||||
}
|
||||
}
|
||||
|
||||
class StationViewHolder extends RecyclerView.ViewHolder{
|
||||
public MarqueeTextView stationName;
|
||||
public ImageView stationCircle;
|
||||
|
||||
@@ -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,7 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
|
||||
@Override
|
||||
public void updatePlateNumber(String plateNumber) {
|
||||
runOnUIThread(() -> mView.updatePlateNum(plateNumber));
|
||||
// runOnUIThread(() -> mView.updatePlateNum(plateNumber));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,7 +132,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 +160,6 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
|
||||
@Override
|
||||
public void updateTotalDistance() {
|
||||
runOnUIThread(() -> mView.setProgressBarMax());
|
||||
// runOnUIThread(() -> mView.setProgressBarMax());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
setBackgroundColor(Color.parseColor("#80FFFFFF"))
|
||||
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,17 @@
|
||||
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.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.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 +22,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,22 +39,8 @@ 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);
|
||||
|
||||
mProgressBar = findViewById(R.id.bus_progress_bar);
|
||||
|
||||
videoSwitch = findViewById(R.id.video_switch_iv);
|
||||
showRouteFragment();
|
||||
|
||||
// mCurrentArriveStation.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
// @Override
|
||||
// public boolean onLongClick(View v) {
|
||||
// showOverviewFragment();
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -127,97 +93,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");
|
||||
@@ -336,7 +336,7 @@ public class BusPassengerMapDirectionView
|
||||
|
||||
@Override
|
||||
public void onCameraChange(CameraPosition cameraPosition) {
|
||||
mIBusPassengerMapViewCallback.onCameraChange(cameraPosition.bearing);
|
||||
// mIBusPassengerMapViewCallback.onCameraChange(cameraPosition.bearing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,33 +1,34 @@
|
||||
package com.mogo.och.bus.passenger.ui;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
|
||||
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
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.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 +38,35 @@ import java.util.List;
|
||||
* @date: 2022/4/12
|
||||
*/
|
||||
public class BusPassengerRouteFragment extends
|
||||
BusPassengerBaseFragment<BusPassengerRouteFragment, BaseBusPassengerPresenter>
|
||||
implements IBusPassengerMapViewCallback {
|
||||
BusPassengerBaseFragment<BusPassengerRouteFragment, BaseBusPassengerPresenter> {
|
||||
|
||||
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 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;
|
||||
|
||||
/**
|
||||
* 改变自动驾驶状态
|
||||
*
|
||||
* @param status 2 - running 1 - enable 2 - disable
|
||||
*/
|
||||
private int mPrevAPStatus = -1;
|
||||
|
||||
@Override
|
||||
public int getStationPanelViewId() {
|
||||
@@ -74,13 +84,22 @@ 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);
|
||||
// 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);
|
||||
|
||||
// mOperationTime = findViewById(R.id.line_operation_time_tv);
|
||||
|
||||
mRouteInfoView = findViewById(R.id.bus_p_line_cl);
|
||||
mStationsListRv = findViewById(R.id.bus_p_line_stations_rl);
|
||||
@@ -90,7 +109,14 @@ public class BusPassengerRouteFragment extends
|
||||
mAdapter = new BusPassengerLineStationsAdapter(getContext(), mStationsList);
|
||||
mStationsListRv.setAdapter(mAdapter);
|
||||
|
||||
mMapArrowIcon = findViewById(R.id.bus_p_arrow_nor);
|
||||
// mMapArrowIcon = findViewById(R.id.bus_p_arrow_nor);
|
||||
|
||||
videoSwitch.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO: 2023/5/4 漫游视频打开/关闭
|
||||
}
|
||||
});
|
||||
|
||||
//测试
|
||||
if (DebugConfig.isDebug()){
|
||||
@@ -109,7 +135,6 @@ public class BusPassengerRouteFragment extends
|
||||
super.initViews(savedInstanceState);
|
||||
mMapDirectionView = findViewById(R.id.bus_p_line_map_view);
|
||||
mMapDirectionView.onCreateView(savedInstanceState);
|
||||
mMapDirectionView.setTaxiPassengerMapViewCallback(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,6 +218,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 +229,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 +244,17 @@ public class BusPassengerRouteFragment extends
|
||||
}
|
||||
}
|
||||
|
||||
public void updatePlateNum(String plateNum){
|
||||
if ("".equals(plateNum) || null == plateNum) {
|
||||
mCarPlateNum.setText("-- --");
|
||||
}else {
|
||||
mCarPlateNum.setText((plateNum));
|
||||
}
|
||||
}
|
||||
// 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 +263,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 +287,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,26 +301,26 @@ public class BusPassengerRouteFragment extends
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraChange(float bearing) {
|
||||
startIvCompass(bearing);
|
||||
}
|
||||
// @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;
|
||||
}
|
||||
// /**
|
||||
// * 设置指南针旋转
|
||||
// *
|
||||
// * @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 +336,84 @@ 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_init));
|
||||
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_init));
|
||||
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip_init));
|
||||
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>";
|
||||
mCurrentArriveTip.setText(Html.fromHtml(strHtml2));
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
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: 555 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
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: 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,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient android:startColor="@android:color/white"
|
||||
android:endColor="#00FFFFFF"
|
||||
android:angle="315"
|
||||
/>
|
||||
</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>
|
||||
@@ -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="match_parent"
|
||||
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,28 +26,6 @@
|
||||
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"
|
||||
@@ -56,94 +40,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.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_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 +57,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 +66,16 @@
|
||||
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:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_20"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -18,7 +18,7 @@
|
||||
android:id="@+id/no_order_data_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/bus_p_no_data_color"
|
||||
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"
|
||||
|
||||
@@ -3,32 +3,62 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="@dimen/dp_40"
|
||||
android:background="@android:color/transparent">
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/edge_view"
|
||||
android:layout_width="725dp"
|
||||
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>
|
||||
<!-- <com.mogo.och.common.module.wigets.OCHBorderShadowLayout-->
|
||||
<!-- android:id="@+id/edge_view"-->
|
||||
<!-- android:layout_width="725dp"-->
|
||||
<!-- 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>-->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/bus_p_route_info_panel_width"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="1120dp"
|
||||
android:background="@drawable/bus_p_route_bg"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
<com.mogo.och.common.module.wigets.MarqueeTextView
|
||||
android:id="@+id/bus_p_line_name_tv"
|
||||
android:layout_width="@dimen/dp_698"
|
||||
android:layout_height="@dimen/dp_76"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:background="@drawable/route_line_name_bg"
|
||||
android:text="@string/bus_p_no_line"
|
||||
android:gravity="center"
|
||||
app:customGap="0.5"
|
||||
app:useCustomGap="true"
|
||||
android:textColor="@color/bus_p_line_name_color"
|
||||
android:textSize="@dimen/bus_p_driver_number_plate_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_goneMarginLeft="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/bus_line_logo"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_line_name_tv"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_line_name_tv"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginLeft="@dimen/dp_194"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHGradientTextView
|
||||
android:id="@+id/bus_p_speed_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -37,7 +67,6 @@
|
||||
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"
|
||||
@@ -51,29 +80,141 @@
|
||||
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"
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/auto_status_iv"
|
||||
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"/>
|
||||
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.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:day_light_mode="true"
|
||||
app:visible="false"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
app:layout_constraintTop_toTopOf="@+id/auto_status_iv"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/auto_status_iv"
|
||||
app:layout_constraintLeft_toRightOf="@+id/auto_status_iv"/>
|
||||
<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"
|
||||
android:layout_width="@dimen/bus_p_route_line_dividing_view_height"
|
||||
android:layout_height="@dimen/dp_156"
|
||||
android:background="@color/bus_p_clock_6617417B"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_speed_tv" />
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_speed_tv" />
|
||||
|
||||
<TextClock
|
||||
android:layout_marginStart="@dimen/dp_64"
|
||||
android:id="@+id/textClockHourMin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:format12Hour="HH:mm"
|
||||
android:format24Hour="HH:mm"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/bus_p_clock_17417B"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
app:layout_constraintLeft_toRightOf="@+id/dividing_line_1"
|
||||
app:layout_constraintTop_toTopOf="@+id/dividing_line_1"
|
||||
android:includeFontPadding="false"
|
||||
android:textSize="@dimen/dp_66" />
|
||||
|
||||
<TextClock
|
||||
android:id="@+id/textClockDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:format12Hour="yyyy年MM月dd日"
|
||||
android:format24Hour="yyyy年MM月dd日"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/bus_p_clock_17417B"
|
||||
android:includeFontPadding="false"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/textClockHourMin"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textClockHourMin"
|
||||
android:textSize="@dimen/dp_26" />
|
||||
|
||||
|
||||
<TextClock
|
||||
android:id="@+id/textClockWeek"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:format12Hour="EEEE"
|
||||
android:format24Hour="EEEE"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/bus_p_clock_17417B"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/textClockDate"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textClockDate"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:includeFontPadding="false"
|
||||
android:textSize="@dimen/dp_26" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/split_line_iv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:src="@drawable/card_split_line_bg"
|
||||
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"
|
||||
app:layout_constraintTop_toBottomOf="@+id/split_line_iv"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_speed_tv"
|
||||
android:text="@string/bus_p_cur_station_title"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/bus_p_line_name_color"
|
||||
android:textSize="@dimen/dp_38"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/speak_arrived_iv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
app:layout_constraintLeft_toRightOf="@+id/bus_p_cur_station_title"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_cur_station_title"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/bus_p_cur_station_title"
|
||||
android:src="@drawable/bg_p_speak_icon_arrived"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bus_p_cur_station_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_57"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textStyle="bold"
|
||||
android:paddingLeft="@dimen/dp_30"
|
||||
android:paddingRight="@dimen/dp_30"
|
||||
android:layout_marginRight="@dimen/dp_90"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:text="@string/bus_p_cur_station_arrived_tip"
|
||||
android:textColor="@android:color/white"
|
||||
android:background="@drawable/cur_station_arrived_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/bus_p_cur_station_title"
|
||||
app:layout_constraintBottom_toBottomOf="@+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:text="-- --"
|
||||
android:textSize="@dimen/dp_56"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
android:textColor="@color/bus_p_clock_17417B"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_title"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_cur_station_title"/>
|
||||
|
||||
<include
|
||||
layout="@layout/bus_p_no_data_common_view"
|
||||
@@ -82,101 +223,48 @@
|
||||
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" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/split_line_iv" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/bus_p_line_cl"
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/bus_p_line_stations_rl"
|
||||
android:layout_width="match_parent"
|
||||
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">
|
||||
android:layout_marginTop="@dimen/dp_76"
|
||||
android:paddingBottom="@dimen/dp_20"
|
||||
android:paddingLeft="@dimen/dp_30"
|
||||
android:paddingRight="@dimen/bus_p_route_info_margin_right"
|
||||
android:requiresFadingEdge="vertical"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_name" />
|
||||
|
||||
<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"
|
||||
app:layout_constraintLeft_toLeftOf="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:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:text="----"
|
||||
app:customGap="0.5"
|
||||
app:useCustomGap="true"
|
||||
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: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" />
|
||||
<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" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/line_operation_time_tv"
|
||||
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" />
|
||||
|
||||
<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"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<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:paddingLeft="@dimen/dp_30"
|
||||
android:paddingRight="@dimen/bus_p_route_info_margin_right"
|
||||
android:requiresFadingEdge="vertical"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dividing_line_2" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</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: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" />
|
||||
|
||||
<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"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- <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"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent" />-->
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -46,8 +46,7 @@
|
||||
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"
|
||||
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_constraintTop_toTopOf="parent"/>
|
||||
|
||||
@@ -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>
|
||||
@@ -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,12 @@
|
||||
<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>
|
||||
</resources>
|
||||
@@ -1,13 +1,13 @@
|
||||
<?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_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 +23,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>
|
||||
|
||||
@@ -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">已到站:</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_arrived_tip">请按秩序下车</string>
|
||||
<string name="bus_p_cur_station_arrived_tip_init">欢迎乘坐蘑菇车联自动驾驶车。</string>
|
||||
</resources>
|
||||
@@ -44,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,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,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,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: 7.3 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/m1_order_closedoor_press" android:state_pressed="true"/>
|
||||
<item android:drawable="@drawable/m1_order_closedoor_normal" android:state_pressed="false"/>
|
||||
<item android:drawable="@drawable/m1_order_closedoor_normal"/>
|
||||
</selector>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient android:startColor="@color/bus_p_m1_80288dfc" android:centerColor="@color/bus_p_m1_3060ABFE" android:endColor="@color/bus_p_m1_0060ABFE"/>
|
||||
</shape>
|
||||
@@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/cl_container"
|
||||
android:background="@drawable/m1_function_bg"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_function_group"
|
||||
app:layout_constraintBottom_toTopOf="@+id/cb_bp_video_player"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_bp_video_player"
|
||||
android:background="@drawable/bus_p_function_bottom_information_bg_selector"
|
||||
android:button="@null"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cb_bp_setting_soft"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="@dimen/dp_181"
|
||||
android:layout_height="@dimen/dp_179"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_bp_setting_soft"
|
||||
android:background="@drawable/bus_p_function_bottom_soft_bg_selector"
|
||||
android:button="@null"
|
||||
app:layout_constraintStart_toEndOf="@+id/cb_bp_video_player"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cb_bp_setting_device"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="@dimen/dp_181"
|
||||
android:layout_height="@dimen/dp_179"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_bp_setting_device"
|
||||
android:background="@drawable/bus_p_function_bottom_device_bg_selector"
|
||||
android:button="@null"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cb_bp_setting_order"
|
||||
app:layout_constraintStart_toEndOf="@+id/cb_bp_setting_soft"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="@dimen/dp_181"
|
||||
android:layout_height="@dimen/dp_179"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_bp_setting_order"
|
||||
android:background="@drawable/bus_p_function_bottom_order_bg_selector"
|
||||
android:button="@null"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cb_bp_setting_device"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="@dimen/dp_181"
|
||||
android:layout_height="@dimen/dp_179"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,82 +0,0 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:clickable="true"
|
||||
android:background="@drawable/bus_p_function_setting_soft_b_shape"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="431:110"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintWidth_percent="0.4589">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_car_setting_go"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:drawableTop="@drawable/bus_p_function_device_go_press_selecor"
|
||||
android:gravity="center"
|
||||
android:text="出发"
|
||||
android:textColor="@color/bus_p_m1_203555"
|
||||
android:textSize="@dimen/dp_28"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_car_setting_stopside"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.492" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_car_setting_stopside"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:drawableTop="@drawable/bus_p_function_device_stopside_press_selecor"
|
||||
android:gravity="center"
|
||||
android:text="靠边停车"
|
||||
android:textColor="@color/bus_p_m1_203555"
|
||||
android:textSize="@dimen/dp_28"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_car_setting_opendoor"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_car_setting_go"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_car_setting_opendoor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:drawableTop="@drawable/bus_p_function_device_opendoor_press_selecor"
|
||||
android:gravity="center"
|
||||
android:text="开车门"
|
||||
android:textColor="@color/bus_p_m1_203555"
|
||||
android:textSize="@dimen/dp_28"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_car_setting_closedoor"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_car_setting_stopside"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_car_setting_closedoor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:drawableTop="@drawable/bus_p_function_device_closedoor_press_selecor"
|
||||
android:gravity="center"
|
||||
android:text="关车门"
|
||||
android:textColor="@color/bus_p_m1_203555"
|
||||
android:textSize="@dimen/dp_28"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_car_setting_opendoor"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,38 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<!-- 订单主页面 -->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:clickable="true"
|
||||
android:background="@drawable/bus_p_function_setting_soft_b_shape"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="1031:500"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintWidth_percent="0.53698">
|
||||
|
||||
<com.mogo.och.bus.passenger.ui.view.LineSiteView
|
||||
android:id="@+id/lsv_line_site"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/m1_order_early_end"
|
||||
android:visibility="gone"
|
||||
layout="@layout/m1_order_early_end"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/m1_order_noorder"
|
||||
android:visibility="gone"
|
||||
layout="@layout/m1_order_noorder"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,238 +0,0 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
<!-- 选择线路和站点页面 -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_line_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cl_side_list"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintWidth_percent="0.35887">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_line_title"
|
||||
android:text="浏览线路"
|
||||
android:textSize="@dimen/dp_26"
|
||||
android:textColor="@color/bus_p_m1_0f1e57"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_31"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_switch_line"
|
||||
android:text="切换"
|
||||
android:textSize="@dimen/dp_22"
|
||||
android:textColor="@color/bus_p_m1_225eff"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_line_title"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_line_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:paddingEnd="@dimen/dp_31"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingBottom="@dimen/dp_10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ImageView
|
||||
android:src="@drawable/m1_order_switch_line_enable"
|
||||
android:id="@+id/iv_switch_line_left"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_switch_line"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_switch_line"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_switch_line"
|
||||
android:layout_marginEnd="@dimen/dp_6"
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_16"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_line_list"
|
||||
android:background="@drawable/m1_order_line_shape"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_line_title"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/m1_line_cancle_submit_bg"
|
||||
android:layout_width="@dimen/dp_275"
|
||||
android:layout_height="@dimen/dp_60"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_line_cancle"
|
||||
android:text="取消"
|
||||
android:textSize="@dimen/dp_20"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintEnd_toStartOf="@+id/gl_line_cancle_submit_guide"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_line_submit"
|
||||
android:text="确认"
|
||||
android:textSize="@dimen/dp_20"
|
||||
app:layout_constraintStart_toEndOf="@+id/gl_line_cancle_submit_guide"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_line_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_line_cancle_submit_bg"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_line_cancle_submit_guide"
|
||||
app:layout_constraintGuide_percent="0.5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_line_submit_group"
|
||||
app:constraint_referenced_ids="tv_line_submit,tv_line_cancle,iv_line_cancle_submit_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_side_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_line_list"
|
||||
app:layout_constraintWidth_percent="0.64113">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_site_list"
|
||||
android:paddingTop="@dimen/dp_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/m1_site_cancle_submit_bg"
|
||||
android:layout_width="@dimen/dp_375"
|
||||
android:layout_height="@dimen/dp_60"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_site_cancle"
|
||||
android:text="取消"
|
||||
android:textSize="@dimen/dp_20"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintEnd_toStartOf="@+id/gl_site_cancle_submit_guide"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_site_submit"
|
||||
android:text="确认"
|
||||
android:textSize="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toEndOf="@+id/gl_site_cancle_submit_guide"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_site_cancle_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_site_cancle_submit_bg"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_site_cancle_submit_guide"
|
||||
app:layout_constraintGuide_percent="0.5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_side_cancle_submit_group"
|
||||
app:constraint_referenced_ids="tv_site_submit,tv_site_cancle,iv_site_cancle_submit_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_site_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/m1_site_submit_bg"
|
||||
android:layout_width="@dimen/dp_258"
|
||||
android:layout_height="@dimen/dp_60"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_site_only_submit"
|
||||
android:text="确认"
|
||||
android:textSize="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_site_submit_bg"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_site_submit_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_site_submit_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_site_submit_bg"
|
||||
android:textColor="@color/bus_p_m1_3b4056"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"/>
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_side_submit_group"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="tv_site_only_submit,iv_site_submit_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_lines_sites_data"
|
||||
app:constraint_referenced_ids="cl_line_list,cl_side_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_loading_wait_driver"
|
||||
android:src="@drawable/bus_p_loading"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.372"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="@dimen/dp_71"
|
||||
android:layout_height="@dimen/dp_73"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_loading_wait_driver_title"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_loading_wait_driver"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_loading_wait_driver"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_loading_wait_driver"
|
||||
android:layout_marginTop="63dp"
|
||||
android:text="等待司机确认信息,请稍候…"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textColor="@color/bus_p_m1_4a5375"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/g_loading_group"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="iv_loading_wait_driver,tv_loading_wait_driver_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<declare-styleable name="MainWindStatus">
|
||||
<attr name="main_wind_drawable" format="reference" />
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.mogo.och.bus.passenger.bean.event
|
||||
|
||||
data class DebugView(val type: String)
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.mogo.och.bus.passenger.bean.event
|
||||
|
||||
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse
|
||||
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse
|
||||
|
||||
data class EventLineSites(val lineInfo: LineInfoResponse.LineInfo, val sites: List<SiteInfoResponse.SiteInfo>)
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.mogo.och.bus.passenger.bean.request
|
||||
|
||||
data class ArriveDestRequest(val sn:String, val lineId:Long,val writeVersion:Long)
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.och.bus.passenger.bean.response
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.och.common.module.bean.dpmsg.LineSite
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
@@ -20,6 +21,10 @@ data class SiteInfoResponse(val data: List<SiteInfo>?) : BaseData(){
|
||||
val type: Int?,
|
||||
var isNear:Boolean=false,
|
||||
var isCheck:Boolean=false,
|
||||
)
|
||||
){
|
||||
fun copy2Mas(): LineSite {
|
||||
return LineSite(lineId,lineName,siteId,siteName,Wgs84Lon,Wgs84Lat,GcjLon,GcjLat,seq,type)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.mogo.och.bus.passenger.bean.response
|
||||
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.och.common.module.bean.dpmsg.LineSite
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
data class TrajectoriesResponse(val data: List<LatLng>?) : BaseData(){
|
||||
data class LatLng(
|
||||
val latitude: Double?,//维度
|
||||
val longitude: Double?,//精度
|
||||
){
|
||||
fun exchangeData(): com.amap.api.maps.model.LatLng{
|
||||
return com.amap.api.maps.model.LatLng(latitude!!,longitude!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.och.bus.passenger.callback
|
||||
|
||||
interface IDistanceTimeCallback {
|
||||
interface IDistanceCallback {
|
||||
fun setDistancecAndTime(meters:Long , timeInSecond:Long )
|
||||
|
||||
fun setOrderTimeCallBack(timeInSecond:Long)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.mogo.och.bus.passenger.callback
|
||||
|
||||
interface ITimeCallback {
|
||||
fun setOrderTimeCallBack(timeInSecond: Long)
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package com.mogo.och.bus.passenger.model
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.net.ConnectivityManager
|
||||
import android.os.Build
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener
|
||||
import com.mogo.commons.module.intent.IntentManager
|
||||
@@ -19,6 +18,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Liste
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -27,17 +27,16 @@ import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.LoopInfo
|
||||
import com.mogo.och.bus.passenger.bean.response.*
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerADASStatusCallback
|
||||
import com.mogo.och.bus.passenger.callback.IBusPassengerControllerStatusCallback
|
||||
import com.mogo.och.bus.passenger.callback.IDistanceTimeCallback
|
||||
import com.mogo.och.bus.passenger.callback.IOrderChangeCallback
|
||||
import com.mogo.och.bus.passenger.callback.*
|
||||
import com.mogo.och.bus.passenger.constant.CharterPassengerConst
|
||||
import com.mogo.och.bus.passenger.constant.CharterPassengerConst.Companion.Charter_AVERAGE_SPEED
|
||||
import com.mogo.och.bus.passenger.net.BusPassengerModelLoopManager
|
||||
import com.mogo.och.bus.passenger.net.BusPassengerServiceManager
|
||||
import com.mogo.och.bus.passenger.utils.VoiceFocusManager
|
||||
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.ChangeDestMsg
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.constant.TaxiLoginStatusEnum
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager
|
||||
@@ -47,17 +46,15 @@ import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.PinYinUtil
|
||||
import com.mogo.och.common.module.voice.VoiceManager
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo_msg.MogoReportMsg
|
||||
import system_master.SystemStatusInfo
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import java.util.TreeMap
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo_msg.MogoReportMsg
|
||||
import system_master.SystemStatusInfo
|
||||
import java.util.*
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.collections.ArrayList
|
||||
import kotlin.collections.HashMap
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
@@ -98,11 +95,12 @@ object CharterPassengerModel {
|
||||
|
||||
private var orderStatus: OrderStatusEnum = OrderStatusEnum.NoOrderUnuse
|
||||
|
||||
private val orderStatusChangeListeners =
|
||||
ConcurrentHashMap<String, IOrderStatusChangeListener>()
|
||||
private val orderStatusChangeListeners = ConcurrentHashMap<String, IOrderStatusChangeListener>()
|
||||
|
||||
private val stationDistanceListener = ConcurrentHashMap<String, IDistanceCallback>()
|
||||
private val orderLeftTimeListeners = ConcurrentHashMap<String, ITimeCallback>()
|
||||
|
||||
private var iDistanceTimeCallback: IDistanceTimeCallback? = null
|
||||
private var leftTime = -1L
|
||||
|
||||
/**
|
||||
* 到站是否播报 key 线路id+业务 value 是否播报
|
||||
@@ -158,10 +156,6 @@ object CharterPassengerModel {
|
||||
mControllerStatusCallbackMap[tag] = callback
|
||||
}
|
||||
|
||||
fun setiDistanceTimeCallback(distanceTimeCallback: IDistanceTimeCallback?) {
|
||||
this.iDistanceTimeCallback = distanceTimeCallback
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动轮询查询司机登录状态
|
||||
*/
|
||||
@@ -273,6 +267,25 @@ object CharterPassengerModel {
|
||||
}
|
||||
orderStatusChangeListeners[tag] = orderStatusChangeListener
|
||||
}
|
||||
fun setStationDistanceListener(tag:String,orderStatusChangeListener: IDistanceCallback?) {
|
||||
if (tag.isBlank()) return
|
||||
if (orderStatusChangeListener == null) {
|
||||
stationDistanceListener.remove(tag)
|
||||
return
|
||||
}
|
||||
stationDistanceListener[tag] = orderStatusChangeListener
|
||||
}
|
||||
fun setOrderLeftTimeListeners(tag:String,orderStatusChangeListener: ITimeCallback?) {
|
||||
if (tag.isBlank()) return
|
||||
if (orderStatusChangeListener == null) {
|
||||
orderLeftTimeListeners.remove(tag)
|
||||
return
|
||||
}
|
||||
orderLeftTimeListeners[tag] = orderStatusChangeListener
|
||||
|
||||
orderStatusChangeListener.setOrderTimeCallBack(leftTime)
|
||||
}
|
||||
|
||||
fun setCarTypeChangeListener(carTypeChageListener: IOrderChangeCallback?){
|
||||
this.carTypeChageListener = carTypeChageListener
|
||||
}
|
||||
@@ -280,6 +293,9 @@ object CharterPassengerModel {
|
||||
fun getCurrentOrderStatus(): OrderStatusEnum {
|
||||
return this.orderStatus
|
||||
}
|
||||
fun getCurrentOrderInfo():OrderInfoResponse.OrderInfo?{
|
||||
return orderInfo
|
||||
}
|
||||
// endregion
|
||||
|
||||
// region 登录状态逻辑
|
||||
@@ -533,14 +549,14 @@ object CharterPassengerModel {
|
||||
it.dispose()
|
||||
}
|
||||
}
|
||||
val leadTime = endlast / 1000+60
|
||||
val leadTime = endlast / 1000
|
||||
subscribeCountDown =
|
||||
Observable.intervalRange(0L, leadTime, 0, 1, TimeUnit.SECONDS)
|
||||
Observable.intervalRange(0L, leadTime, 0, 5, TimeUnit.SECONDS)
|
||||
.map { aLong -> leadTime - aLong }
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe{millisUntilFinished->
|
||||
if (millisUntilFinished <= 360L) {
|
||||
if (millisUntilFinished <= 300L) {
|
||||
orderInfo?.let {
|
||||
val isPlayed = SharedPrefs.getInstance(mContext)
|
||||
.getBoolean("${it.orderNo}$min5Speak", false)
|
||||
@@ -564,14 +580,12 @@ object CharterPassengerModel {
|
||||
it.dispose()
|
||||
}
|
||||
}
|
||||
iDistanceTimeCallback?.setOrderTimeCallBack(-1)
|
||||
invokeOrderLeftTimeListeners(-1)
|
||||
invokeStationDistanceListener(-1,-1)
|
||||
}else{
|
||||
iDistanceTimeCallback?.setOrderTimeCallBack(millisUntilFinished)
|
||||
invokeOrderLeftTimeListeners(millisUntilFinished)
|
||||
}
|
||||
CallerLogger.d(
|
||||
M_BUS_P + TAG,
|
||||
"倒计时${millisUntilFinished}"
|
||||
)
|
||||
CallerLogger.d(M_BUS_P + TAG, "订单倒计时${millisUntilFinished}")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -625,95 +639,52 @@ object CharterPassengerModel {
|
||||
private fun calculateDistance() {
|
||||
//mLocation gcj坐标
|
||||
mLocationGCJ02?.let {
|
||||
var lastSumLength = 0f
|
||||
orderInfo?.let { order ->
|
||||
// 启动轨迹计算
|
||||
//当前站在轨迹中对应的点
|
||||
val currentRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndexNew(
|
||||
0, mRoutePoints, it.longitude, it.latitude
|
||||
)
|
||||
var nextRouteIndex: Int = mRoutePoints.size - 1
|
||||
|
||||
var lastSumLength = 0f
|
||||
val orderLonLat =
|
||||
CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(
|
||||
mContext,
|
||||
order.wgs84Lon!!,
|
||||
order.wgs84Lat!!
|
||||
)
|
||||
//要前往的站在轨迹中对应的点
|
||||
nextRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndexNew(
|
||||
currentRouteIndex, mRoutePoints,
|
||||
val mogoLocation = MogoLocation()
|
||||
mogoLocation.longitude = orderLonLat.longitude
|
||||
mogoLocation.latitude = orderLonLat.latitude
|
||||
|
||||
lastSumLength = CoordinateUtils.calculateLineDistance(
|
||||
orderLonLat.longitude,
|
||||
orderLonLat.latitude
|
||||
orderLonLat.latitude,
|
||||
mogoLocation.longitude,
|
||||
mogoLocation.latitude
|
||||
)
|
||||
// 距离站点最近的轨迹点
|
||||
val lastPoints = mRoutePoints.get(nextRouteIndex)
|
||||
// 站点距离最近点的距离
|
||||
val calculateLineDistance = CoordinateUtils.calculateLineDistance(
|
||||
lastPoints.longitude, lastPoints.latitude,
|
||||
orderLonLat.longitude, orderLonLat.latitude
|
||||
)
|
||||
if (currentRouteIndex < nextRouteIndex) {
|
||||
// subList 是[) 需要的是[]
|
||||
val subList = mRoutePoints.subList(currentRouteIndex, nextRouteIndex + 1)
|
||||
// 轨迹点所有的距离
|
||||
val middlePoingDistancee =
|
||||
CoordinateCalculateRouteUtil.calculateRouteSumLength(subList)
|
||||
|
||||
// 需要加距离 和下一个轨迹点成钝角
|
||||
if (nextRouteIndex + 1 < mRoutePoints.size) {
|
||||
val lastPointsNext = mRoutePoints.get(nextRouteIndex + 1)
|
||||
val degree = CoordinateCalculateRouteUtil.getDegree(
|
||||
orderLonLat.longitude,orderLonLat.latitude,
|
||||
lastPoints.longitude, lastPoints.latitude,
|
||||
lastPointsNext.longitude, lastPointsNext.latitude,
|
||||
if(lastSumLength>100) {
|
||||
// 计算距离
|
||||
lastSumLength =
|
||||
CoordinateCalculateRouteUtil.calculateRouteSumLength(
|
||||
mRoutePoints,
|
||||
it,
|
||||
mogoLocation
|
||||
)
|
||||
if (degree > 90) {
|
||||
lastSumLength = middlePoingDistancee + calculateLineDistance
|
||||
}
|
||||
}
|
||||
// 需要减距离 和上一个轨迹点成钝角
|
||||
if (nextRouteIndex - 1 >= 0) {
|
||||
val lastPointsPre = mRoutePoints.get(nextRouteIndex - 1)
|
||||
val degree = CoordinateCalculateRouteUtil.getDegree(
|
||||
orderLonLat.longitude,orderLonLat.latitude,
|
||||
lastPoints.longitude, lastPoints.latitude,
|
||||
lastPointsPre.longitude, lastPointsPre.latitude,
|
||||
)
|
||||
if (degree > 90) {
|
||||
lastSumLength = middlePoingDistancee - calculateLineDistance
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
val lastPoints = mRoutePoints.get(nextRouteIndex)
|
||||
lastSumLength = CoordinateUtils.calculateLineDistance(
|
||||
lastPoints.longitude, lastPoints.latitude,
|
||||
it.longitude, it.latitude
|
||||
)
|
||||
}
|
||||
// 距离小于100m 直接计算当前位置距离站点的距离
|
||||
if(lastSumLength<=100){
|
||||
lastSumLength = CoordinateUtils.calculateLineDistance(
|
||||
orderLonLat.longitude,
|
||||
orderLonLat.latitude,
|
||||
it.longitude,
|
||||
it.latitude
|
||||
)
|
||||
|
||||
val lastTime: Double = lastSumLength / it.gnssSpeed * 3.6 //秒
|
||||
|
||||
CallerLogger.d(M_BUS_P + "calculateDistance",
|
||||
"---lastSumLength: " + lastSumLength + "----lastTime : " + lastTime
|
||||
+ " thread = " + Thread.currentThread().name
|
||||
)
|
||||
if (lastSumLength < CharterPassengerConst.ARRIVE_AT_START_STATION_DISTANCE) {
|
||||
CallerLogger.d(M_BUS_P + TAG,"小于15米到站2")
|
||||
arriveDest()
|
||||
return
|
||||
}
|
||||
if(order.arriveStatus==OrderInfoResponse.ARRIVING) {
|
||||
invokeStationDistanceListener(lastSumLength.toLong(), lastTime.toLong())
|
||||
}else{
|
||||
invokeStationDistanceListener(-1,-1)
|
||||
}
|
||||
}
|
||||
val lastTime: Double = lastSumLength / Charter_AVERAGE_SPEED * 3.6 //秒
|
||||
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_BUS_P + "calculateDistance",
|
||||
"---lastSumLength: " + lastSumLength + "----lastTime : " + lastTime
|
||||
+ " thread = " + Thread.currentThread().name
|
||||
)
|
||||
if (lastSumLength < CharterPassengerConst.ARRIVE_AT_START_STATION_DISTANCE) {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG,"小于15米到站2")
|
||||
arriveDest()
|
||||
}
|
||||
iDistanceTimeCallback?.setDistancecAndTime(lastSumLength.toLong(), lastTime.toLong())
|
||||
}
|
||||
}
|
||||
// endregion
|
||||
@@ -848,40 +819,71 @@ object CharterPassengerModel {
|
||||
BusPassengerServiceManager.endOrder(mContext, it, callback)
|
||||
}
|
||||
}
|
||||
fun getLineTrajectory(lineId: Long,callback: OchCommonServiceCallback<TrajectoriesResponse>?) {
|
||||
BusPassengerServiceManager.queryLineLocation(mContext, lineId = lineId.toString(), callback)
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun arriveDest() {
|
||||
orderInfo?.lineId?.let {
|
||||
orderInfo?.siteId?.let { siteId ->
|
||||
if (orderInfo!!.arriveStatus == OrderInfoResponse.ARRIVING) {
|
||||
if (broadcastList.get("${siteId}$endKey") == null || broadcastList.get("${siteId}$endKey") == false) {
|
||||
BusPassengerServiceManager.arriveDest(
|
||||
mContext, lindId = it, object : OchCommonServiceCallback<BaseData> {
|
||||
override fun onSuccess(data: BaseData?) {
|
||||
if (null != data && 0 == data.code) {
|
||||
VoiceManager.arrivedStation(
|
||||
orderInfo!!.siteName!!,
|
||||
orderInfo!!.siteNameKr ?: "",
|
||||
VoiceFocusManager.getVoiceCmdCallBack()
|
||||
)
|
||||
broadcastList["${siteId}$endKey"] = true
|
||||
// 到站结束自驾
|
||||
CallerAutoPilotControlManager.cancelAutoPilot()
|
||||
// 结束路距计算
|
||||
endCalculateDistanceLoop()
|
||||
// 到站置距离位0
|
||||
iDistanceTimeCallback?.setOrderTimeCallBack(-1)
|
||||
}
|
||||
}
|
||||
orderInfo?.let { order->
|
||||
order.lineId?.let {lineId->
|
||||
order.siteId?.let { siteId ->
|
||||
if (order.arriveStatus == OrderInfoResponse.ARRIVING) {
|
||||
if (broadcastList["${siteId}$endKey"] == null || broadcastList["${siteId}$endKey"] == false) {
|
||||
val currentTimeStamp = DateTimeUtil.getCurrentTimeStamp()
|
||||
BusPassengerServiceManager.arriveDest(
|
||||
mContext,
|
||||
lindId = lineId,
|
||||
writtenVersion = currentTimeStamp,
|
||||
object : OchCommonServiceCallback<BaseData> {
|
||||
override fun onSuccess(data: BaseData?) {
|
||||
if (null != data && 0 == data.code) {
|
||||
VoiceManager.arrivedStation(
|
||||
order.siteName!!,
|
||||
order.siteNameKr ?: "",
|
||||
VoiceFocusManager.getVoiceCmdCallBack()
|
||||
)
|
||||
broadcastList["${siteId}$endKey"] = true
|
||||
// 给司机端
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
ToastUtils.showShort("$code:$msg")
|
||||
}
|
||||
})
|
||||
}
|
||||
val msg = ChangeDestMsg(
|
||||
order.orderNo?:":",
|
||||
lineId.toInt(),
|
||||
order.lineName?:"",
|
||||
order.startSiteId?:0,
|
||||
order.startSiteName?:"",
|
||||
siteId.toInt(),
|
||||
order.siteName,
|
||||
true,
|
||||
2,
|
||||
currentTimeStamp
|
||||
)
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
CallerLogger.d(M_BUS_P + BaseDPMsg.TAG, "到站发送数据${msg}")
|
||||
|
||||
// 到站结束自驾
|
||||
CallerAutoPilotControlManager.cancelAutoPilot()
|
||||
// 结束路距计算
|
||||
endCalculateDistanceLoop()
|
||||
// 到站置距离位0
|
||||
invokeStationDistanceListener(-1,-1)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String) {
|
||||
ToastUtils.showShort("$code:$msg")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun cleanbroadcastListInfo(){
|
||||
@@ -983,4 +985,22 @@ object CharterPassengerModel {
|
||||
it.lineName!!,it.startSiteName!!,it.siteName!!,false)
|
||||
}
|
||||
}
|
||||
|
||||
private fun invokeOrderLeftTimeListeners(timeInSecond: Long){
|
||||
leftTime = timeInSecond
|
||||
UiThreadHandler.post({
|
||||
for (value in orderLeftTimeListeners.values) {
|
||||
value.setOrderTimeCallBack(timeInSecond)
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
private fun invokeStationDistanceListener(meters:Long , timeInSecond:Long){
|
||||
UiThreadHandler.post({
|
||||
for (value in stationDistanceListener.values) {
|
||||
value.setDistancecAndTime(meters,timeInSecond)
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.mogo.och.bus.passenger.model
|
||||
|
||||
/**
|
||||
* Created on 2022/08/19
|
||||
*
|
||||
*
|
||||
* 0 初始状态,
|
||||
* 10 已登录,
|
||||
* 20 已登出,
|
||||
*/
|
||||
enum class OrderStatusEnum() {
|
||||
Nothing(),
|
||||
NoOrderUnuse(), //无订单车闲置 m1_order_noorder.xml 无订单页面
|
||||
OrderNoLine(), //有订单无线路 m1_order_lineside 选择线路页面
|
||||
OrdersWithLine(), //有订单有线路 m1_order_lineside 选择线路页面隐藏掉确定取消
|
||||
NoOrderUse(),; //无订单车不闲置 m1_order_end.xml 开门关门页面
|
||||
}
|
||||
|
||||
interface IOrderStatusChangeListener {
|
||||
fun onStatusChange(currentStatus:OrderStatusEnum)
|
||||
}
|
||||