Merge branch 'dev_robotaxi-d_240401_6.4.0' into 'master'

[Publish] 鹰眼V6.4.0

See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!865
This commit is contained in:
aibingbing
2024-05-10 10:15:00 +00:00
1370 changed files with 13648 additions and 8923 deletions

View File

@@ -1,6 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
@@ -15,9 +16,10 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
kapt {
useBuildCache = false
arguments {
arg("AROUTER_MODULE_NAME", "bus"+project.getName())
}
}
}
@@ -42,21 +44,6 @@ android {
}
}
flavorDimensions "vehicle"
productFlavors {
// 车型:金旅星辰、开沃 小巴业务
jinlvvan {
dimension "vehicle"
buildConfigField 'int', 'NEW_TEST', '0'
}
// 车型金旅m2 小巴业务
m2 {
dimension "vehicle"
buildConfigField 'int', 'NEW_TEST', '1'
}
}
}
dependencies {
@@ -64,7 +51,7 @@ dependencies {
implementation rootProject.ext.dependencies.kotlinstdlib
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.arouter
annotationProcessor rootProject.ext.dependencies.aroutercompiler
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.amapnavi3dmap

View File

@@ -0,0 +1,37 @@
package com.mogo.och.bus
import android.content.Context
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.och.bus.fragment.BusFragment
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.biz.provider.CommonService
import com.mogo.och.common.module.biz.provider.CommonServiceImpl
/**
* 网约车小巴业务实现入口
*
* @author tongchenfei
*/
@Route(path = OchCommonConst.BUS_DRIVER)
class BusDriverProvider : CommonServiceImpl() {
private val tag = BusDriverProvider::class.java.simpleName
private var busFragment: BusFragment?=null
override fun getFragment(): Fragment {
if(busFragment==null){
busFragment = BusFragment()
}
return busFragment!!
}
override fun resetFragment() {
busFragment = null
}
override fun init(context: Context) {
CallerLogger.d(tag, "准备show fragment")
}
}

View File

@@ -1,100 +0,0 @@
package com.mogo.och.bus;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
import android.content.Context;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.och.bus.constant.BusConst;
import com.mogo.och.bus.fragment.BusFragment;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* 网约车小巴业务实现入口
*
* @author tongchenfei
*/
@Route(path = BusConst.PATH)
public class BusProvider implements IMogoOCH {
private static final String TAG = "BusProvider";
private BusFragment busFragment;
private int containerId;
private FragmentActivity activity;
/**
* 进入鹰眼模式,设置手势缩放地图失效
*/
private void stepIntoVrMode() {
CallerLogger.d(M_BUS + TAG, "进入vr模式");
CallerMoGoUiSettingManager.INSTANCE.stepInNightMode();//夜间模式 状态栏字体颜色变黑
}
@Override
public void init(Context context) {
}
private void showFragment() {
FragmentManager supportFragmentManager = activity.getSupportFragmentManager();
if (busFragment == null) {
CallerLogger.d(TAG, "准备add fragment======");
Fragment fragmentByTag = supportFragmentManager.findFragmentByTag(BusFragment.TAG);
if (fragmentByTag instanceof BusFragment) {
busFragment = (BusFragment) fragmentByTag;
} else {
busFragment = new BusFragment();
}
if(!busFragment.isAdded()) {
supportFragmentManager.beginTransaction().add(containerId, busFragment, BusFragment.TAG).commitAllowingStateLoss();
}
return;
}
CallerLogger.d(TAG, "准备show fragment");
supportFragmentManager.beginTransaction().show(busFragment).commitAllowingStateLoss();
}
private void hideFragment() {
if (busFragment != null) {
CallerLogger.d(TAG, "准备hide fragment");
activity.getSupportFragmentManager().beginTransaction().hide(busFragment).commitAllowingStateLoss();
}
}
@Override
public void createCoverage(FragmentActivity activity, int containerId) {
}
@NotNull
@Override
public String getFunctionName() {
return TAG;
}
@Nullable
@Override
public Fragment createCoverage(@Nullable FragmentActivity fragmentActivity, @Nullable Integer integer) {
this.containerId = integer;
this.activity = fragmentActivity;
showFragment();
return null;
}
@Override
public void onDestroy() {
//若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
if (activity == null) return;
activity.finish();
}
}

View File

@@ -1,24 +0,0 @@
package com.mogo.och.bus;
import androidx.annotation.IdRes;
import androidx.fragment.app.FragmentActivity;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
public
/**
* @author congtaowang
* @since 2021/1/15
*
* 网约车抽象接口
*/
interface IMogoOCH extends IMoGoFunctionProvider {
/**
* 初始化网约车容器
*
* @param activity
* @param containerId 容器ID
*/
void createCoverage(FragmentActivity activity, @IdRes int containerId);
}

View File

@@ -8,8 +8,6 @@ import com.mogo.eagle.core.data.map.MogoLocation;
* Model->Presenter回调状态控制器监听accOn、adas ui show、voice ui show、push ui show、v2x ui show等等
*/
public interface IBusControllerStatusCallback {
// 是否vr map模式
void onVRModeChanged(boolean isVRMode);
// 自车定位
void onCarLocationChanged(MogoLocation location);
//开始开启自动驾驶

View File

@@ -19,10 +19,12 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import com.mogo.commons.AbsMogoApplication;
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.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
@@ -46,6 +48,7 @@ import com.mogo.och.bus.util.BDRouteDataTestUtils;
import com.mogo.och.bus.view.BizMapView;
import com.mogo.och.bus.view.SlidePanelView;
import com.mogo.och.common.module.utils.SoundPoolHelper;
import com.mogo.och.common.module.utils.ResourcesUtils;
import org.greenrobot.eventbus.EventBus;
@@ -74,7 +77,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
private FrameLayout flStationPanelContainer;
private BizMapView mapBizView;
private Group groupTestPanel;
private TrafficDataView mTrafficDataView;
// private TrafficDataView mTrafficDataView;
// private BusTrafficLightView mTrafficLightView;
//远景和中景的切换
@@ -92,6 +95,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
public boolean isAnimateRunning = false;
/**
* 滑动按钮触发的事件
*/
@@ -123,7 +127,15 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
// tvOperationStatus = findViewById(R.id.module_mogo_och_operation_status);
tvArrived = findViewById(R.id.module_mogo_och_arrived_tv);
mTrafficDataView = (TrafficDataView) findViewById(R.id.bus_arc);
// mTrafficDataView = (TrafficDataView) findViewById(R.id.bus_arc);
FrameLayout flSpeed = findViewById(R.id.fl_speed);
if (flSpeed != null) {
CallerDevaToolsManager.INSTANCE.attachAutopilotBeforeLaunchView(flSpeed.getContext(), flSpeed);
}
LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer);
slidePanelView.setOnSlidePanelMoveToEndListener(onSlideToEndListener);
@@ -157,7 +169,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
});
initListener();
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState());
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() {
@Override
@@ -205,7 +217,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
mBadcaseBtn = findViewById(R.id.module_mogo_och_badcase_rl);
if (mBadcaseBtn != null) {
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn);
CallerDevaToolsManager.INSTANCE.reportWorkOrder(mBadcaseBtn);
}
//消息盒子
@@ -293,9 +305,12 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
@Override
public void onDestroyView() {
mapBizView.onDestroy();
super.onDestroyView();
if(smallMapView != null){
smallMapView.onDestroy();
}
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
EventBus.getDefault().unregister(this);
super.onDestroyView();
}
/**
@@ -313,10 +328,13 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
* @param text 指定的文字
*/
public void showSlidePanel(String text) {
getActivity().runOnUiThread(() -> {
slidePanelView.setText(text);
slidePanelView.setVisibility(View.VISIBLE);
});
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
slidePanelView.setText(text);
slidePanelView.setVisibility(View.VISIBLE);
}
},UiThreadHandler.MODE.QUEUE);
setArrivedClickable(false);
}
@@ -326,23 +344,29 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
* @param isClickable
*/
public void setArrivedClickable(boolean isClickable) {
getActivity().runOnUiThread(() -> {
tvArrived.setEnabled(isClickable);
if (isClickable) {
tvArrived.setTextColor(getResources().getColor(R.color.bus_white));
} else {
tvArrived.setTextColor(getResources().getColor(R.color.bus_arrived_btn_un_clickable_color));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
tvArrived.setEnabled(isClickable);
if (isClickable) {
tvArrived.setTextColor(ResourcesUtils.getColor(R.color.bus_white));
} else {
tvArrived.setTextColor(ResourcesUtils.getColor(R.color.bus_arrived_btn_un_clickable_color));
}
}
});
},UiThreadHandler.MODE.QUEUE);
}
/**
* 隐藏滑动按钮
*/
public void hideSlidePanel() {
getActivity().runOnUiThread(() -> {
slidePanelView.setVisibility(View.GONE);
});
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
slidePanelView.setVisibility(View.GONE);
}
},UiThreadHandler.MODE.QUEUE);
}
public void playDI() {
@@ -354,40 +378,46 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
*
* @param autopilotStatus 0:不可用 1:可用状态 2:自动驾驶中
*/
public void onAutopilotStatusChanged(int autopilotStatus) {
getActivity().runOnUiThread(() -> {
changeAutopilotBtnView(autopilotStatus, isAnimateRunning);
});
public void onAutopilotStatusChanged(int autopilotStatus,boolean canStartAutopilt) {
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
changeAutopilotBtnView(autopilotStatus, isAnimateRunning,canStartAutopilt);
}
},UiThreadHandler.MODE.QUEUE);
}
public void setAutopilotBtnStatus(int autopilotStatus) {
public void setAutopilotBtnStatus(int autopilotStatus,boolean canStartAutopilt) {
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE
== autopilotStatus) {//0不可用
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_disable));
ctvAutopilotStatusTv.setTextColor(AbsMogoApplication.getApp().getColor(R.color.bus_autopilot_text_color_disable));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_disable_autopilot_icon);
// ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.bus_autopilot_0_1_status_bg));
ctvAutopilotStatus.setBackgroundResource(R.drawable.bus_autopilot_0_1_status_bg);
} else {
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setTextColor(AbsMogoApplication.getApp().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_ic_autopilot);
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == autopilotStatus) { //1可用
// ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_runnig_tv));
ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.bus_autopilot_0_1_status_bg));
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_runnig_tv));
if(canStartAutopilt){
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatus.setBackgroundResource(R.drawable.bus_autopilot_0_1_status_bg);
}else {
ctvAutopilotStatusTv.setTextColor(AbsMogoApplication.getApp().getColor(R.color.bus_autopilot_text_color_disable));
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_disable_autopilot_icon);
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatus.setBackgroundResource(R.drawable.bus_autopilot_0_1_status_bg);
}
} else if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == autopilotStatus) {
ctvAutopilotStatusTv.setText(R.string.bus_loading_autopilot_runnig_tv);
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.bus_autopilot_2_status_bg));
// ctvAutopilotStatus.setSelected(true);
ctvAutopilotStatus.setBackgroundResource(R.drawable.bus_autopilot_2_status_bg);
} else if (IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING
== autopilotStatus) {
ctvAutopilotStatusTv.setText(R.string.bus_pingxing_driver);
ctvAutopilotStatus.setClickable(false);
ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.pingxingjiashi));
ctvAutopilotStatus.setBackgroundResource(R.drawable.common_autopilot_pxjs);
}
}
@@ -397,21 +427,21 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
== autopilotStatus) {//2 running
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_right_autopilot_icon);
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_success_tv));
ctvAutopilotStatusTv.setTextColor(ResourcesUtils.getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_success_tv));
// ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setClickable(false);
} else {
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_wrong_autopilot_icon);
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_failure_tv));
ctvAutopilotStatusTv.setTextColor(ResourcesUtils.getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_failure_tv));
ctvAutopilotStatus.setClickable(false);
// ctvAutopilotStatus.setSelected(false);
}
UiThreadHandler.postDelayed(() -> setAutopilotBtnStatus(autopilotStatus), 1000);
UiThreadHandler.postDelayed(() -> setAutopilotBtnStatus(autopilotStatus,CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0)), 1000);
}
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning) {
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning, boolean canStartAutopilt) {
if (isAnimateRunning && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
!= autopilotStatus) {
// 主动开启自动驾驶中不为2为0、1则继续loading
@@ -420,7 +450,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
if (isAnimateRunning) {
stopAnimAndUpdateBtnStatus();
} else {
setAutopilotBtnStatus(autopilotStatus);
setAutopilotBtnStatus(autopilotStatus,canStartAutopilt);
}
}
@@ -434,19 +464,12 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
* 隐藏【自动驾驶】按钮
*/
public void hideAutopilotBiz() {
getActivity().runOnUiThread(() -> {
// ctvAutopilotStatus.setVisibility(View.GONE);
// slidePanelView.setVisibility(View.GONE);
});
}
/**
* 展示【自动驾驶】按钮
*/
public void showAutopilotBiz() {
// getActivity().runOnUiThread(() -> {
// ctvAutopilotStatus.setVisibility(View.VISIBLE);
// });
}
public SlidePanelView.OnSlidePanelMoveToEndListener getSlidePanelOnEndListener() {
@@ -477,9 +500,8 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
*/
public void startAutopilotAnimation() {
isAnimateRunning = true;
ctvAutopilotStatusTv.setText(getResources().getString(R.string.bus_loading_autopilot_tv));
ctvAutopilotStatusTv.setTextColor(getResources().getColor(R.color.bus_autopilot_text_color_normal));
// ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_tv));
ctvAutopilotStatusTv.setTextColor(ResourcesUtils.getColor(R.color.bus_autopilot_text_color_normal));
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_loading_autopilot_icon);
if (autopilotLoadingAnimator == null) {
@@ -517,22 +539,19 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
}
}
/**
* 迈速表实时更新
*/
public void updateSpeedView(float newSpeed) {
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
if (mTrafficDataView != null) {
mTrafficDataView.updateSpeedWithValue(speed);
}
}
// /**
// * 迈速表实时更新
// */
// public void updateSpeedView(float newSpeed) {
// int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
// if (mTrafficDataView != null) {
// mTrafficDataView.updateSpeedWithValue(speed);
// }
// }
@Override
public void onDestroy() {
super.onDestroy();
if(smallMapView != null){
smallMapView.onDestroy();
}
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG);
}

View File

@@ -15,7 +15,6 @@ import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.storage.SharedPrefsMgr;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.temp.EventLogout;
@@ -26,22 +25,21 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant;
import com.mogo.eagle.core.utilcode.util.ActivityUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.overlay.IMoGoOverlayManager;
import com.mogo.map.overlay.core.Level;
import com.mogo.map.overlay.point.Point;
import com.mogo.och.bus.R;
import com.mogo.och.bus.bean.BusStationBean;
import com.mogo.och.bus.constant.BusConst;
import com.mogo.och.bus.net.login.LoginBusImpl;
import com.mogo.och.bus.presenter.BusPresenter;
import com.mogo.och.bus.ui.BusStationCommonItem;
import com.mogo.och.bus.ui.BusSwitchLineActivity;
import com.mogo.och.bus.view.SlidePanelView;
import com.mogo.och.common.module.biz.constant.OchCommonConst;
import com.mogo.och.common.module.biz.provider.LoginService;
import com.mogo.och.common.module.utils.BlinkAnimationUtil;
import com.mogo.och.common.module.utils.OCHThreadPoolManager;
import com.mogo.och.common.module.utils.QRUtilsKt;
import com.mogo.och.common.module.utils.ResourcesUtils;
import com.mogo.och.common.module.wigets.BindQRCodeDialog;
import com.mogo.och.common.module.wigets.MarqueeTextView;
import com.mogo.och.common.module.wigets.OCHCommitDialog;
@@ -75,8 +73,6 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
private BusStationCommonItem secondStationItem;
private BusStationCommonItem thirdStationItem;
private LoginService loginService;
@Override
public String getTagName() {
return "BusFragment";
@@ -85,17 +81,19 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
if (loginService != null) {
loginService.registerFragment(this, getPresenter(), new LoginBusImpl());
}
}
@Override
public void onDestroyView() {
if (mPresenter != null) {
mPresenter.onDestroy(this);
}
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
if(overlayManager!=null) {
overlayManager.removeAllLines();
overlayManager.removeAllPoints();
}
super.onDestroyView();
loginService.unRegisterFragment();
loginService = null;
}
@Override
@@ -203,20 +201,23 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
return;
}
getActivity().runOnUiThread(() -> {
if (stationList == null) {
// 获取小巴数据失败
return;
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (stationList == null) {
// 获取小巴数据失败
return;
}
showStationsPanel();
showOrHideSwitchLineBtn(false);
mLineName.setText(lineName);
mTaskTime.setText(getString(R.string.bus_line_time_tag)+ lineTime);
// 渲染小巴路线数据
updateBusStationStatus(stationList,arrivingOrArrivedIndex,isArrived);
}
showStationsPanel();
showOrHideSwitchLineBtn(false);
mLineName.setText(lineName);
mTaskTime.setText(getString(R.string.bus_line_time_tag)+ lineTime);
// 渲染小巴路线数据
updateBusStationStatus(stationList,arrivingOrArrivedIndex,isArrived);
});
},UiThreadHandler.MODE.QUEUE);
}
private void updateBusStationStatus(List<BusStationBean> stationList,
@@ -278,23 +279,23 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
if (arrivingOrArrivedIndex == 0 || arrivingOrArrivedIndex -1 == 0
|| (arrivingOrArrivedIndex -2 == 0 && stationList.size() == 3)){
firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start));
firstStationItem.setStationTag(ResourcesUtils.getString(R.string.bus_station_txt_tag_start));
}else {
firstStationItem.setStationTag("");
}
if (arrivingOrArrivedIndex + 1 == stationList.size() - 1 || arrivingOrArrivedIndex == stationList.size() - 1
|| (arrivingOrArrivedIndex == 0 && arrivingOrArrivedIndex + 2 == stationList.size() - 1)){ //确认是否显示 "终"
thirdStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_end));
thirdStationItem.setStationTag(ResourcesUtils.getString(R.string.bus_station_txt_tag_end));
}else {
thirdStationItem.setStationTag("");
}
//圆点: 0:灰色 过站 1绿色 到站或者即将到站 2蓝色未到站
if (arrivingOrArrivedIndex == 0 && isArrived){
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
secondStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_arrived_station_name_text_color));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationName(stationList.get(0).getName());
secondStationItem.setStationName(stationList.get(1).getName());
@@ -308,9 +309,9 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
secondStationItem.setStationArrowBg(2);
}else if (arrivingOrArrivedIndex == stationList.size() - 1){
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -2).getName());
secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName());
@@ -328,9 +329,9 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
}
}else {
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName());
secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex).getName());
@@ -364,23 +365,23 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
secondStationItem.showOrHideStationArrowBg(false);
thirdStationItem.showOrHideStationArrowBg(false);
firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start));
thirdStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_end));
firstStationItem.setStationTag(ResourcesUtils.getString(R.string.bus_station_txt_tag_start));
thirdStationItem.setStationTag(ResourcesUtils.getString(R.string.bus_station_txt_tag_end));
firstStationItem.setStationName(stationList.get(0).getName());
thirdStationItem.setStationName(stationList.get(1).getName());
//圆点: 0:灰色 过站 1绿色 到站或者即将到站 2蓝色未到站
if (arrivingOrArrivedIndex == 0 && isArrived){//到站
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationPointBg(1);
firstStationItem.setStationArrowBg(2);
thirdStationItem.setStationPointBg(0);
}else {
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
firstStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(ResourcesUtils.getColor(R.color.bus_line_station_color_selected));
if (isArrived){ //到终点
firstStationItem.setStationPointBg(0);
firstStationItem.setStationArrowBg(0);
@@ -397,10 +398,10 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
private void showOrHideSwitchLineBtn(boolean isShow) {
if (isShow){//显示切换路线
mSwitchLine.setTag(0);
mSwitchLine.setText(getResources().getString(R.string.bus_switch_line_btn));
mSwitchLine.setText(ResourcesUtils.getString(R.string.bus_switch_line_btn));
}else {//显示结束路线
mSwitchLine.setTag(1);
mSwitchLine.setText(getResources().getString(R.string.bus_close_line_btn));
mSwitchLine.setText(ResourcesUtils.getString(R.string.bus_close_line_btn));
}
}
@@ -410,7 +411,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
@Override
public int getStationPanelViewId() {
return R.layout.fragment_och_bus;
return R.layout.bug_fragment_och;
}
@Override
@@ -461,17 +462,6 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
smallMapView.clearPolyline();
}
/**
* VR模式切换
*
* @param isVRMode
*/
public void onVRModeChanged(boolean isVRMode) {
if (mRootView != null) {
mRootView.setVisibility(isVRMode ? View.VISIBLE : View.GONE);
}
}
/**
* 绘制地图起点终点
*
@@ -525,7 +515,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
//本次行程未结束不支持切换路线。点击则toast提示当前行程未完成不可切换路线
if (CallerAutoPilotStatusListenerManager.INSTANCE.getState()
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
ToastUtils.showLong(getResources().getString(R.string.bus_switch_line_btn_warning1));
ToastUtils.showLong(ResourcesUtils.getString(R.string.bus_switch_line_btn_warning1));
return;
}
if ((int)mSwitchLine.getTag() == 0){//切换路线

View File

@@ -13,8 +13,8 @@ import com.mogo.och.bus.bean.BusRoutesResponse;
import com.mogo.och.bus.callback.IBusLinesCallback;
import com.mogo.och.bus.net.OrderServiceManager;
import com.mogo.och.bus.ui.BusSwitchLineActivity;
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
import com.mogo.och.common.module.manager.orderlogmanager.OchChainLogManager;
import com.mogo.och.common.module.network.OchCommonServiceCallback;
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager;
/**
* @author: wangmingjun

View File

@@ -12,7 +12,6 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.elegant.network.utils.GsonUtil;
import com.mogo.aicloud.services.socket.IMogoOnMessageListener;
import com.mogo.commons.AbsMogoApplication;
@@ -55,27 +54,30 @@ import com.mogo.och.bus.util.BusAnalyticsManager;
import com.mogo.och.bus.util.BusSendTripInfoManager;
import com.mogo.och.bus.util.BusTrajectoryManager;
import com.mogo.och.bus.util.BusVoiceManager;
import com.mogo.och.common.module.bean.dpmsg.AppConnectMsg;
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager;
import com.mogo.och.common.module.biz.common.socketmessage.data.OCHOperationalMessage;
import com.mogo.och.common.module.biz.constant.OchCommonConst;
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
import com.mogo.och.common.module.biz.provider.LoginService;
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager;
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager;
import com.mogo.och.common.module.manager.socket.lan.bean.AppConnectMsg;
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager;
import com.mogo.och.common.module.manager.socket.cloud.data.OCHOperationalMessage;
import com.mogo.och.common.module.constant.OchCommonConst;
import com.mogo.och.common.module.biz.login.LoginStatusManager;
import com.mogo.och.common.module.network.OchCommonServiceCallback;
import com.mogo.och.common.module.callback.OchAdasStartFailureCallback;
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager;
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
import com.mogo.och.common.module.manager.autopilotmanager.autopilot.ArrivedStation;
import com.mogo.och.common.module.manager.autopilotmanager.trajectory.ITrajectoryListListener;
import com.mogo.och.common.module.manager.autopilotmanager.trajectory.TrajectoryManager;
import com.mogo.och.common.module.manager.distancemamager.ITrajectoryListener;
import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager;
import com.mogo.och.common.module.manager.orderlogmanager.OchChainLogManager;
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager;
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager;
import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation;
import com.mogo.och.common.module.manager.autopilot.trajectory.ITrajectoryListListener;
import com.mogo.och.common.module.manager.autopilot.trajectory.TrajectoryManager;
import com.mogo.och.common.module.manager.distance.ITrajectoryListener;
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager;
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager;
import com.mogo.och.common.module.utils.DateTimeUtil;
import com.mogo.och.common.module.utils.MultiRequestLimitChecker;
import com.mogo.och.common.module.utils.NumberFormatUtil;
import com.mogo.och.common.module.utils.OCHThreadPoolManager;
import com.mogo.och.common.module.utils.PinYinUtil;
import com.mogo.och.common.module.utils.ToastUtilsOch;
import com.mogo.och.common.module.voice.VoiceNotice;
import org.jetbrains.annotations.NotNull;
@@ -123,8 +125,6 @@ public class OrderModel {
//0: 代表没有启动过 1代表是启动第一次当>=1 代表是重试 每次到站/路线结束清空置为0
private volatile int firstStartAutopilot = 0;
private LoginService loginService;
private final Handler handler = new Handler(msg -> {
if (msg.what == MSG_QUERY_BUS_STATION) {
queryBusRoutes();
@@ -149,12 +149,9 @@ public class OrderModel {
public void init() {
mContext = AbsMogoApplication.getApp();
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
// 定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,5, mMapLocationListener);
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
TrajectoryManager.INSTANCE.addTrajectoryListListenerr(TAG,iTrajectoryListener);
//开启自驾后 异常信息返回
@@ -309,13 +306,11 @@ public class OrderModel {
startOrStopOrderLoop(false);
//startOrStopQueryPassengerWriteOff(false);
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
// 注销定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
TrajectoryManager.INSTANCE.addTrajectoryListListenerr(TAG,null);
loginService = null;
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null);
@@ -329,18 +324,6 @@ public class OrderModel {
TrajectoryAndDistanceManager.INSTANCE.removeListener(TAG);
}
private final IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() {
// VR mode变更回调
@Override
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
if (StatusDescriptor.VR_MODE == descriptor) {
if (mControllerStatusCallback != null) {
mControllerStatusCallback.onVRModeChanged(isTrue);
}
}
}
};
private final OchAdasStartFailureCallback mAdasStartFailureListener = new OchAdasStartFailureCallback() {
@Override
public void brakeStatusChanged(boolean isBrakeAvailable) {
@@ -362,7 +345,6 @@ public class OrderModel {
@Override
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
if (null == gnssInfo) return;
Logger.d(TAG, "onChassisLocationGCJ02");
if (mControllerStatusCallback != null) {
mControllerStatusCallback.onCarLocationChanged(gnssInfo);
}
@@ -536,7 +518,6 @@ public class OrderModel {
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
// 取消自驾
setTrajectoryStation(null,null,-1L);
// startOrStopQueryPassengerWriteOff(false);
}
}
@@ -624,9 +605,11 @@ public class OrderModel {
// 非自驾状态---->预写日志----> 启动自驾 ---> 自驾启动成功 ----> 上报日志
//  自驾状态---->启动自驾 ---> 自驾启动成功
//根据开关和后台是否发布轨迹启动自驾
if (FunctionBuildConfig.isPassStartAutopilotCommand && TextUtils.isEmpty(busRoutesResult.csvFileUrl)
&& TextUtils.isEmpty(busRoutesResult.csvFileUrlDPQP)){
//1、判断轨迹url是否可用
if (FunctionBuildConfig.isPassStartAutopilotCommand
&& TextUtils.isEmpty(busRoutesResult.csvFileUrl)
&& TextUtils.isEmpty(busRoutesResult.csvFileUrlDPQP)
){
ToastUtils.showLong("无发布轨迹, 请发布后重试");
CallerLogger.e(M_BUS + TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand
@@ -634,11 +617,37 @@ public class OrderModel {
+ "busRoutesResult.csvFileUrlDPQP = "+busRoutesResult.csvFileUrlDPQP);
return;
}
//2、6个条件判断
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true, 0)) {
return;
}
CallerLogger.e(M_BUS + TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand);
//3、距离轨迹15m计算
String resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
if(TrajectoryAndDistanceManager.errorTypeNoneLineId.equals(resion)){
MogoLocation nextStationPoint = new MogoLocation();
if (backgroundCurrentStationIndex < stationList.size() - 1) {
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
nextStationPoint.setLongitude(nextStation.getGcjLon());
nextStationPoint.setLatitude(nextStation.getGcjLat());
}
BusStationBean busStationBean = stationList.get(backgroundCurrentStationIndex);
MogoLocation currentStationPoint = new MogoLocation();
currentStationPoint.setLongitude(busStationBean.getGcjLon());
currentStationPoint.setLatitude(busStationBean.getGcjLat());
setTrajectoryStation(currentStationPoint,nextStationPoint, (long)busRoutesResult.getLineId());
resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
}
if(!StringUtils.isEmpty(resion)){
ToastUtils.showShort(resion);
VoiceNotice.showNotice(resion);
return;
}
//4、ssm 给出数据
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
", 请稍候重试");
@@ -646,11 +655,7 @@ public class OrderModel {
return;
}
String resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
if(!StringUtils.isEmpty(resion)){
ToastUtils.showShort(resion);
return;
}
firstStartAutopilot++;
@@ -665,7 +670,7 @@ public class OrderModel {
return;
}
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
OchAutoPilotManager.startAutoPilot(parameters);
CallerLogger.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
+ " startLatLon=" + parameters.startName + "endLatLon=" + parameters.endName +
@@ -1136,9 +1141,7 @@ public class OrderModel {
public void sendWriteOffNumToClient(String msg){
AppConnectMsg passengerMsg = new AppConnectMsg(false,true,msg,-1);
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(passengerMsg).getBytes());
LanSocketManager.sendMsgToClient(passengerMsg);
}
// 车机端上传心跳数据(只在出车状态时上传)
@@ -1172,7 +1175,7 @@ public class OrderModel {
public void logout() {
double mLatitude = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLatitude();
double mLongitude =CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLongitude();
loginService.loginOut(mLatitude, mLongitude);
LoginStatusManager.loginOut(mLatitude, mLongitude);
}
public void triggerStartServiceEvent(boolean isRestart, boolean send) {
@@ -1267,26 +1270,6 @@ public class OrderModel {
return parameters;
}
public void setStation(){
BusStationBean busStationBean = stationList.get(backgroundCurrentStationIndex);
String nextStationName = "";
String nextStationNameKr = "";
MogoLocation nextStationPoint = new MogoLocation();
if (backgroundCurrentStationIndex < stationList.size() - 1) {
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
nextStationName = nextStation.getName();
nextStationNameKr = nextStation.getNameKr();
nextStationPoint.setLongitude(nextStation.getGcjLon());
nextStationPoint.setLatitude(nextStation.getGcjLat());
}
final String currentStationName = busStationBean.getName();
String finalNextStationName = nextStationName;
String finalNextStationNameKr = nextStationNameKr;
MogoLocation currentStationPoint = new MogoLocation();
currentStationPoint.setLongitude(busStationBean.getGcjLon());
currentStationPoint.setLatitude(busStationBean.getGcjLat());
}
public void setTrajectoryStation(MogoLocation startStation,MogoLocation endStation,Long lineId){
TrajectoryAndDistanceManager.INSTANCE.setStationPoint(startStation,endStation,lineId);
}

View File

@@ -8,10 +8,10 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.och.bus.bean.*
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
import com.mogo.och.common.module.biz.network.interceptor.transformTry
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.network.OchCommonServiceCallback
import com.mogo.och.common.module.network.OchCommonSubscribeImpl
import com.mogo.och.common.module.network.interceptor.transformTry
/**
* @author: wangmingjun

View File

@@ -1,47 +0,0 @@
package com.mogo.och.bus.net.login
import android.content.Context
import com.mogo.eagle.core.data.BaseData
import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean
import com.mogo.och.common.module.biz.bean.TaxiLoginReqBean
import com.mogo.och.common.module.biz.bean.TaxiLoginRespBean
import com.mogo.och.common.module.biz.bean.TaxiLogoutReqBean
import com.mogo.och.common.module.biz.network.LoginDefaultManage
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
class LoginBusImpl: LoginDefaultManage {
override fun getPhoneCode(
context: Context, phone: String?,
callback: OchCommonServiceCallback<BaseData>?
) {
OchCommonServiceManager.getPhoneCode(context,phone,callback)
}
override fun gotoLoginBycode(
context: Context,
phone: String?,
code: String?,
location4Login: TaxiLoginReqBean.Location4Login?,
callback: OchCommonServiceCallback<TaxiLoginRespBean>?
) {
OchCommonServiceManager.gotoLoginBycode(context,phone,code,location4Login,callback)
}
override fun logout(
context: Context,
location4Login: TaxiLogoutReqBean.Location4Login?,
callback: OchCommonServiceCallback<BaseData>?
) {
OchCommonServiceManager.logout(context,location4Login,callback)
}
override fun queryDriverServiceStatus(
context: Context,
callback: OchCommonServiceCallback<DriverStatusQueryRespBean>?
) {
OchCommonServiceManager.queryDriverServiceStatus(context,callback)
}
}

View File

@@ -62,7 +62,14 @@ public class BusLinePresenter extends Presenter<BusSwitchLineView> implements IB
@Override
public void onChangeLineIdSuccess() {
OrderModel.getInstance().clearBusStationDatas();
runOnUIThread(() -> mView.onChangeLineIdSuccess());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.onChangeLineIdSuccess();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
public void queryBusLines(){
@@ -105,6 +112,8 @@ public class BusLinePresenter extends Presenter<BusSwitchLineView> implements IB
@Override
public void onBusLineTasks(BusQueryLineTaskResponse o, int position,boolean autoRefresh) {
mView.onBusLineTasks(o,position,autoRefresh);
if(mView!=null) {
mView.onBusLineTasks(o,position,autoRefresh);
}
}
}

View File

@@ -13,6 +13,7 @@ import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -27,13 +28,13 @@ import com.mogo.och.bus.fragment.BusFragment;
import com.mogo.och.bus.model.OrderModel;
import com.mogo.och.bus.util.BusTrajectoryManager;
import com.mogo.och.bus.util.BusVoiceManager;
import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean;
import com.mogo.och.common.module.biz.callback.ILoginCallback;
import com.mogo.och.common.module.biz.constant.LoginStatusManager;
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
import com.mogo.och.common.module.manager.autopilotmanager.autopilot.ArrivedStation;
import com.mogo.och.common.module.manager.autopilotmanager.autopilot.IOchAutopilotStatusListener;
import com.mogo.och.common.module.manager.autopilotmanager.autopilot.OchAutoPilotStatusListenerManager;
import com.mogo.och.common.module.biz.login.ILoginCallback;
import com.mogo.och.common.module.biz.login.LoginStatusEnum;
import com.mogo.och.common.module.biz.login.LoginStatusManager;
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager;
import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation;
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener;
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager;
import com.zhjt.mogo.adas.data.AdasConstants;
import java.util.ArrayList;
@@ -59,9 +60,9 @@ public class BusPresenter extends Presenter<BusFragment>
public BusPresenter(BusFragment view) {
super(view);
//2021.11.1 鹰眼架构整合由IMoGoAutopilotStatusListener逐步替代IMogoAdasOCHCallback接口
OchAutoPilotStatusListenerManager.INSTANCE.addListener(TAG,this);
OrderModel.getInstance().init();
OCHAdasAbilityManager.getInstance().init(AbsMogoApplication.getApp());
}
@Override
@@ -83,6 +84,8 @@ public class BusPresenter extends Presenter<BusFragment>
OrderModel.getInstance().setControllerStatusCallback(this);
OrderModel.getInstance().setPassengerCallback(this);
OrderModel.getInstance().setAdasStatusCallback(this);
OchAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
LoginStatusManager.INSTANCE.addListener(TAG, this);
}
public void releaseListener() {
@@ -92,6 +95,8 @@ public class BusPresenter extends Presenter<BusFragment>
OrderModel.getInstance().setPassengerCallback(null);
OrderModel.getInstance().setAdasStatusCallback(null);
OCHAdasAbilityManager.getInstance().release();
OchAutoPilotStatusListenerManager.INSTANCE.removeListener(TAG);
LoginStatusManager.INSTANCE.removeListener(TAG);
}
public void abortTask() {
@@ -103,7 +108,7 @@ public class BusPresenter extends Presenter<BusFragment>
}
public void restartAutopilot() {
if (OrderModel.getInstance().isGoingToNextStation()){
if (OrderModel.getInstance().isGoingToNextStation()) {
OrderModel.getInstance().restartAutopilot();
}
}
@@ -114,32 +119,51 @@ public class BusPresenter extends Presenter<BusFragment>
}
@Override
public void updateBusTaskStatus(String lineName,String lineTime,
public void updateBusTaskStatus(String lineName, String lineTime,
List<BusStationBean> stationList,
int arrivingOrArrivedIndex,
boolean isArrived) {
mStationList.clear();
mStationList.addAll(stationList);
if (arrivingOrArrivedIndex == 0 || isArrived){
if (arrivingOrArrivedIndex == 0 || isArrived) {
mCurrentStation = arrivingOrArrivedIndex;
}else {
mCurrentStation = arrivingOrArrivedIndex -1;
} else {
mCurrentStation = arrivingOrArrivedIndex - 1;
}
CallerLogger.d(M_BUS + "BusOrderModel =", " mCurrentStation =" + mCurrentStation);
if (mView != null) {
runOnUIThread(() -> mView.updateBusTaskStatus(lineName,lineTime,
stationList, arrivingOrArrivedIndex, isArrived));
}
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.updateBusTaskStatus(lineName, lineTime,
stationList, arrivingOrArrivedIndex, isArrived);
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void updateEmptyUi() {
runOnUIThread(() -> mView.updateLineEmptyUI());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.updateLineEmptyUI();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void clearBusStationsMarkers() {
runOnUIThread(() -> mView.clearBusStationsMarkers());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.clearBusStationsMarkers();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
@@ -152,12 +176,12 @@ public class BusPresenter extends Presenter<BusFragment>
@Override
public void onAutopilotArriveAtStation(ArrivedStation arrivedStation) {
CallerLogger.e( M_BUS + TAG, "行程日志-onAutopilotArriveAtStation arrive");
arriveStation(arrivedStation,"底盘触发进站");
CallerLogger.e(M_BUS + TAG, "行程日志-onAutopilotArriveAtStation arrive");
arriveStation(arrivedStation, "底盘触发进站");
}
public void arriveStation(ArrivedStation arrivedStation,String type){
OrderModel.getInstance().onArriveAt(arrivedStation,type);
public void arriveStation(ArrivedStation arrivedStation, String type) {
OrderModel.getInstance().onArriveAt(arrivedStation, type);
}
@Override
@@ -181,52 +205,62 @@ public class BusPresenter extends Presenter<BusFragment>
return;
}
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(state));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}
}, UiThreadHandler.MODE.QUEUE);
break;
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
OrderModel.getInstance().triggerStartServiceEvent(
OrderModel.getInstance().isRestartAutopilot(), true);
OrderModel.getInstance().isRestartAutopilot(), true);
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(state));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.onAutopilotStatusChanged(state, CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}
}, UiThreadHandler.MODE.QUEUE);
break;
default:
runOnUIThread(() -> mView.onAutopilotEnableChange(false));
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.onAutopilotEnableChange(false);
}
}
}, UiThreadHandler.MODE.QUEUE);
break;
}
}
@Override
public void onVRModeChanged(boolean isVRMode) {
runOnUIThread(() -> mView.onVRModeChanged(isVRMode));
}
@Override
public void onCarLocationChanged(MogoLocation location) {
if (null != location) {
runOnUIThread(() -> mView.updateSpeedView((float) location.getGnssSpeed()));
}
}
@Override
public void startOpenAutopilot() {
//非美化模式下启动动画
runOnUIThread(() -> mView.startAutopilotAnimation());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (mView != null) {
mView.startAutopilotAnimation();
}
}
}, UiThreadHandler.MODE.QUEUE);
//中间站点再次开启自驾时, 自动驾驶状态是2未改变 此次鹰眼底层不再返给业务,需优化按钮动画显示
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
== CallerAutoPilotStatusListenerManager.INSTANCE.getState()){
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState());
}
}
private void runOnUIThread(Runnable executor) {
if (executor == null) {
return;
}
if (Looper.myLooper() != Looper.getMainLooper()) {
UiThreadHandler.post(executor);
} else {
executor.run();
== CallerAutoPilotStatusListenerManager.INSTANCE.getState() && mView != null) {
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
}
}
@@ -237,56 +271,37 @@ public class BusPresenter extends Presenter<BusFragment>
onAutopilotStatusResponse(status);
}
@Override
public void onAutopilotRouteLineId(long lineId) {
@Override
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo, long lineId) {
BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo, lineId);
}
@Override
public void onAutopilotGuardian(MogoReportMsg.MogoReportMessage guardianInfo) {
BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo);
}
@Override
public void onAutopilotIpcConnectStatusChanged(@NonNull AdasConstants.IpcConnectionStatus status, @Nullable String reason) {
}
@Override
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
}
@Override
public void onSystemStatus(@NonNull SsmInfo.SsmStatusInf statusInf) {
}
@Override
public void loginSuccess(DriverStatusQueryRespBean data) {
public void onStatusChange(LoginStatusEnum currentStatus) {
CallerLogger.d(M_BUS + TAG, " loginStatus =" + LoginStatusManager.isLogin());
if(LoginStatusManager.isLogin()){
if (LoginStatusManager.isLogin()) {
OrderModel.getInstance().startOrStopOrderLoop(true);
OrderModel.getInstance().queryBusRoutes();
}else {
} else {
BusTrajectoryManager.getInstance().stopTrajReqLoop();
OrderModel.getInstance().startOrStopOrderLoop(false);
BusTrajectoryManager.getInstance().stopTrajReqLoop();
clearBusStationsMarkers();
mView.hideSlidePanel();
if(mView!=null) {
mView.hideSlidePanel();
}
OrderModel.getInstance().closeBeautificationMode();
}
}
@Override
public void loginFail(boolean isLogin) {
}
@Override
public void playPassenger(WriteOffPassenger passenger) {
int passengerNum = passenger.passengerSize;
if (passengerNum > 1){ //多人播报 "x人" ---》x人核验通过
OrderModel.getInstance().sendWriteOffNumToClient(passengerNum+"人核验通过");
}else { //是 1 播放 "滴" 2022.11.09 改为: "核验通过"
if (passengerNum > 1) { //多人播报 "x人" ---》x人核验通过
OrderModel.getInstance().sendWriteOffNumToClient(passengerNum + "人核验通过");
} else { //是 1 播放 "滴" 2022.11.09 改为: "核验通过"
// mView.playDI();
OrderModel.getInstance().sendWriteOffNumToClient("核验通过");
}
@@ -295,14 +310,20 @@ public class BusPresenter extends Presenter<BusFragment>
@Override
public void onStartAdasFailure() {
runOnUIThread(() -> mView.stopAnimAndUpdateBtnStatus());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if(mView!=null) {
mView.stopAnimAndUpdateBtnStatus();
}
}
}, UiThreadHandler.MODE.QUEUE);
}
@Override
public void onAutopilotDockerInfo(@NonNull String dockerVersion) {
}
@Override
public void onSsmReceiveTimeout(boolean isTimeout) {
public void canStartAutopilot(boolean canStart) {
if(mView!=null) {
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), canStart);
}
}
}

View File

@@ -42,7 +42,7 @@ class BusSwitchLineActivity : MvpActivity<BusSwitchLineView?, BusLinePresenter?>
private lateinit var linearLayoutManager:LinearLayoutManager
private val mData: MutableList<BusQueryLinesResponse.Result> = ArrayList()
override fun getLayoutId(): Int {
return R.layout.activity_bus_switch_line
return R.layout.bus_switch_line
}
override fun createPresenter(): BusLinePresenter {

View File

@@ -11,7 +11,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
import com.mogo.och.bus.constant.BusConst
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
import com.mogo.och.common.module.utils.RxUtils
import io.reactivex.disposables.Disposable

View File

@@ -9,9 +9,8 @@ import com.mogo.eagle.core.utilcode.util.GsonUtils;
import com.mogo.och.bus.bean.BusRoutesResult;
import com.mogo.och.bus.constant.BusConst;
import com.mogo.och.bus.model.OrderModel;
import com.mogo.och.common.module.biz.constant.LoginStatusManager;
import com.mogo.och.common.module.manager.orderlogmanager.OchChainLogManager;
import com.zhidao.socket.utils.LoginStatusUtil;
import com.mogo.och.common.module.biz.login.LoginStatusManager;
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager;
import java.util.concurrent.TimeUnit;
@@ -64,6 +63,10 @@ public class BusTrajectoryManager {
}
}
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo,long lineId) {
onAutopilotGuardian(guardianInfo);
}
/**
* 接口MEC反馈的常规信息MAP v2.5.0新增轨迹相关信息)
* @param guardianInfo

View File

@@ -21,7 +21,7 @@ object BusVoiceManager {
}
fun arrivedStationBus(siteNameCN: String?, siteNameKR: String?) {
if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) {
if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
return
}
val context = AbsMogoApplication.getApp()

View File

@@ -20,9 +20,9 @@ class BizMapView @JvmOverloads constructor(
private lateinit var mapBizView: MapBizView
init {
if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) {
if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
LayoutInflater.from(context).inflate(R.layout.bus_m2_bizmap_map, this, true)
}else if(AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)){
}else if(AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)){
LayoutInflater.from(context).inflate(R.layout.bus_jl_bizmap_map, this, true)
}else{
LayoutInflater.from(context).inflate(R.layout.bus_jl_bizmap_map, this, true)

View File

@@ -27,7 +27,7 @@ import com.mogo.eagle.core.utilcode.util.ConvertUtils;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.bus.R;
import com.mogo.och.common.module.manager.orderlogmanager.OchChainLogManager;
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager;
import me.jessyan.autosize.AutoSizeConfig;
import me.jessyan.autosize.utils.AutoSizeUtils;

View File

Before

Width:  |  Height:  |  Size: 323 B

After

Width:  |  Height:  |  Size: 323 B

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

Before

Width:  |  Height:  |  Size: 491 B

After

Width:  |  Height:  |  Size: 491 B

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 1004 B

After

Width:  |  Height:  |  Size: 1004 B

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 377 B

After

Width:  |  Height:  |  Size: 377 B

View File

Before

Width:  |  Height:  |  Size: 400 B

After

Width:  |  Height:  |  Size: 400 B

View File

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 402 B

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/press_start_status">
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_press">
</item>
<item android:drawable="@drawable/start_failure">
<item android:drawable="@drawable/common_autopilot_unable">
</item>
</selector>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/press_start_status">
<item android:state_pressed="true" android:drawable="@drawable/common_autopilot_press">
</item>
<item android:drawable="@drawable/start_success">
<item android:drawable="@drawable/common_autopilot_in_autopilot">
</item>
</selector>

View File

@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/module_och_bus_order_status_stationInfo"
android:layout_width="@dimen/module_mogo_och_autopilot_order_bg_width"
android:layout_width="@dimen/dp_616"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/dp_28"
android:background="@drawable/bus_line_panel_bg"
@@ -96,8 +96,9 @@
android:id="@+id/switch_line_btn"
android:layout_width="@dimen/bus_switch_line_btn_width_1"
android:layout_height="@dimen/bus_switch_line_btn_height_1"
android:layout_marginLeft="@dimen/dp_28"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginStart="@dimen/dp_29"
android:layout_marginEnd ="@dimen/dp_27"
app:layout_goneMarginTop="@dimen/dp_600"
android:background="@drawable/bus_switch_line_btn"
android:gravity="center"

View File

@@ -21,20 +21,11 @@
<FrameLayout
android:id="@+id/fl_speed"
android:layout_width="@dimen/dp_616"
android:layout_height="@dimen/dp_320"
android:layout_marginLeft="@dimen/dp_13"
android:layout_marginTop="@dimen/dp_40"
android:visibility="visible"
android:layout_width="@dimen/dp_618"
android:layout_height="@dimen/dp_269"
android:layout_marginStart="@dimen/dp_10"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView
android:id="@+id/bus_arc"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
app:layout_constraintTop_toTopOf="parent"/>
<!--V2X预警红色边框-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
@@ -163,9 +154,12 @@
<RelativeLayout
android:id="@+id/module_mogo_och_autopilot_status"
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
android:layout_height="@dimen/module_mogo_och_autopilot_status_bg_height"
android:layout_marginLeft="@dimen/dp_13"
android:layout_width="@dimen/dp_616"
android:layout_height="@dimen/dp_185"
android:layout_marginStart="@dimen/dp_9"
android:layout_marginTop="-31dp"
android:paddingTop="@dimen/dp_27"
android:paddingBottom="@dimen/dp_32"
android:background="@drawable/bus_autopilot_0_1_status_bg"
android:gravity="center"
app:layout_constraintLeft_toLeftOf="parent"
@@ -198,9 +192,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_13"
android:layout_marginTop="-24dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call" />
/>
<include
android:id="@+id/module_mogo_och_bus_test_bar"
@@ -409,4 +404,9 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<com.mogo.och.common.module.wigets.LoadingMapStatusView
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -19,7 +19,7 @@ android {
kapt {
useBuildCache = false
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
arg("AROUTER_MODULE_NAME", "bus"+project.getName())
}
}
}
@@ -58,20 +58,6 @@ android {
]
}
}
flavorDimensions "vehicle"
productFlavors {
// 车型:金旅星辰、开沃 小巴业务
jinlvvan {
dimension "vehicle"
buildConfigField 'int', 'NEW_TEST', '0'
}
// 车型金旅m1 小巴业务
m2 {
dimension "vehicle"
buildConfigField 'int', 'NEW_TEST', '1'
}
}
}
dependencies {

View File

@@ -0,0 +1,71 @@
package com.mogo.och.bus.passenger
import android.content.Context
import android.view.View
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils
import com.mogo.och.bus.passenger.passenger.ui.PM2BaseFragment
import com.mogo.och.bus.passenger.passenger.ui.widget.M2StatusBarView
import com.mogo.och.bus.passenger.ui.BusPStatusBarView
import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.biz.provider.CommonServiceImpl
import com.mogo.och.common.module.wigets.media.MediaPlayerActivity
/**
* 网约车-Bus-乘客端
*
* Created on 2022/3/29
*/
@Route(path = OchCommonConst.BUS_PASSENGER)
class BusPassengerProvider : CommonServiceImpl() {
private val tag = BusPassengerProvider::class.java.simpleName
private var mPM2Fragment: Fragment?=null
override fun getFragment(): Fragment {
if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
MultiDisplayUtils.startActWithSecond(ActivityUtils.getTopActivity(), MediaPlayerActivity::class.java)
}
if(mPM2Fragment==null){
mPM2Fragment = if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
PM2BaseFragment()
} else if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
BusPassengerRouteFragment()
} else {
BusPassengerRouteFragment()
}
}
return mPM2Fragment!!
}
override fun resetFragment() {
super.resetFragment()
mPM2Fragment = null
}
override fun getStatusBarView(context: Context): View {
if(statusBarView==null) {
statusBarView = if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
M2StatusBarView(context)
} else if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
BusPStatusBarView(context)
} else{
BusPStatusBarView(context)
}
}
return statusBarView!!
}
override fun init(context: Context) {
CallerLogger.d(SceneConstant.M_TAXI_P + tag, "init")
}
}

View File

@@ -1,22 +0,0 @@
package com.mogo.och.bus.passenger;
import androidx.annotation.IdRes;
import androidx.fragment.app.FragmentActivity;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
/**
* 网约车抽象接口
*
* Created on 2022/3/29
*/
interface IMogoOCH extends IMoGoFunctionProvider {
/**
* 初始化网约车容器
*
* @param activity
* @param containerId 容器ID
*/
void createCoverage(FragmentActivity activity, @IdRes int containerId);
}

View File

@@ -1,105 +0,0 @@
package com.mogo.och.bus.passenger
import android.content.Context
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager.stepInDayMode
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils
import com.mogo.och.bus.passenger.constant.BusPassengerConst
import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment
import com.mogo.och.bus.passenger.passenger.ui.PM2BaseFragment
import com.mogo.och.common.module.wigets.media.MediaPlayerActivity
/**
* 网约车-Bus-乘客端
*
* Created on 2022/3/29
*/
@Route(path = BusPassengerConst.PATH)
class MogoOCHBusPassenger : IMoGoFunctionProvider {
private var mActivity: FragmentActivity? = null
private var mContainerId = 0
private var mPM2Fragment: Fragment? = null
override fun createCoverage(activity: FragmentActivity?, containerId: Int?): Fragment? {
mActivity = activity
mContainerId = containerId!!
showFragment()
if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
mActivity?.let {
MultiDisplayUtils.startActWithSecond(it, MediaPlayerActivity::class.java)
}
}
return null
}
override val functionName: String
get() = "och-bus-passenger-m2"
override fun onDestroy() {
// 若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
mActivity?.finish()
}
override fun init(context: Context) {
}
/**
* 进入鹰眼模式,设置手势缩放地图失效
*/
private fun stepIntoVrMode() {
d(SceneConstant.M_TAXI_P + TAG, "进入vr模式")
stepInDayMode() //白天模式 状态栏字体颜色变黑
}
private fun showFragment() {
val supportFragmentManager: FragmentManager? = mActivity?.supportFragmentManager
if (mPM2Fragment == null) {
d(SceneConstant.M_TAXI_P + TAG, "准备add fragment======")
val fragmentByTag: Fragment? = supportFragmentManager?.findFragmentByTag(PM2BaseFragment.TAG)
mPM2Fragment = if (fragmentByTag is Fragment){
fragmentByTag
}else{
if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) {
PM2BaseFragment()
}else if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
BusPassengerRouteFragment()
}else{
BusPassengerRouteFragment()
}
}
if (!mPM2Fragment?.isAdded!!){
supportFragmentManager?.beginTransaction()
?.add(mContainerId, mPM2Fragment!!, PM2BaseFragment.TAG)?.commitAllowingStateLoss()
}
return
}
d(SceneConstant.M_TAXI_P + TAG, "准备show fragment")
supportFragmentManager?.beginTransaction()?.show(mPM2Fragment!!)
?.commitAllowingStateLoss()
}
private fun hideFragment() {
if (mPM2Fragment != null) {
mActivity?.supportFragmentManager?.beginTransaction()?.hide(mPM2Fragment!!)
?.commitAllowingStateLoss()
}
}
companion object {
private val TAG = MogoOCHBusPassenger::class.java.simpleName
}
}

View File

@@ -9,10 +9,10 @@ import com.mogo.och.bus.passenger.bean.BusPassengerQueryLineRequest
import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
import com.mogo.och.common.module.biz.network.interceptor.transformTry
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.network.OchCommonServiceCallback
import com.mogo.och.common.module.network.OchCommonSubscribeImpl
import com.mogo.och.common.module.network.interceptor.transformTry
/**
* Created on 2022/3/31

View File

@@ -1,41 +0,0 @@
package com.mogo.och.bus.passenger.provider;
import android.content.Context;
import android.view.View;
import androidx.annotation.NonNull;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.och.bus.passenger.passenger.ui.widget.M2StatusBarView;
import com.mogo.och.bus.passenger.ui.BusPStatusBarView;
/**
* @author congtaowang
* @since 2020-01-06
* <p>
* 根据优先级控制显示 window view.
*/
@Route( path = MogoServicePaths.PATH_STATUS_VIEW_MANAGER )
public class StatusViewManager implements IStatusViewLayout {
@NonNull
@Override
public View getStatusView(Context context) {
if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) {
return new M2StatusBarView(context);
} else if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
return new BusPStatusBarView(context);
}
return new BusPStatusBarView(context);
}
@Override
public void init(Context context) {
}
}

View File

@@ -19,20 +19,17 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager.addListener
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
import com.mogo.eagle.core.network.utils.GsonUtil
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isPassenger
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.NetworkUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
@@ -43,23 +40,26 @@ import com.mogo.och.bus.passenger.callback.*
import com.mogo.och.bus.passenger.constant.BusPassengerConst
import com.mogo.och.bus.passenger.network.BusPassengerServiceManager
import com.mogo.och.bus.passenger.network.BusPassengerServiceManager.driverAppSn
import com.mogo.och.common.module.bean.dpmsg.AppConnectMsg
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
import com.mogo.och.common.module.bean.dpmsg.DPMsgType
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager.pushAppOperationalMsgBox
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager.startLoopAbnormalFactors
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager.stopLoopAbnormalFactors
import com.mogo.och.common.module.manager.distancemamager.IDistanceListener
import com.mogo.och.common.module.manager.distancemamager.ITrajectoryListener
import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager.addDistanceListener
import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager.addTrajectoryListener
import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager.setStationPoint
import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager.suspendCalculate
import com.mogo.och.common.module.manager.loopmanager.BizLoopManager
import com.mogo.och.common.module.manager.loopmanager.LoopInfo
import com.mogo.och.common.module.manager.socket.lan.bean.AppConnectMsg
import com.mogo.och.common.module.manager.socket.lan.bean.BaseDPMsg
import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager.pushAppOperationalMsgBox
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
import com.mogo.och.common.module.network.OchCommonServiceCallback
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager.startLoopAbnormalFactors
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager.stopLoopAbnormalFactors
import com.mogo.och.common.module.manager.distance.IDistanceListener
import com.mogo.och.common.module.manager.distance.ITrajectoryListener
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager.addDistanceListener
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager.addTrajectoryListener
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager.setStationPoint
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager.suspendCalculate
import com.mogo.och.common.module.manager.loop.BizLoopManager
import com.mogo.och.common.module.manager.loop.LoopInfo
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.common.module.utils.OCHThreadPoolManager
import com.mogo.och.common.module.utils.PinYinUtil
@@ -334,7 +334,7 @@ object BusPassengerModel {
private fun initListeners() {
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
CallerAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener)
OchAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener)
IntentManager.getInstance()
.registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener)
MogoStatusManager.getInstance().registerStatusChangedListener(
@@ -363,7 +363,7 @@ object BusPassengerModel {
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
MogoAiCloudSocketManager.getInstance(mContext)
.unregisterLifecycleListener(10010)
CallerAutoPilotStatusListenerManager.removeListener(mGoAutopilotStatusListener)
OchAutoPilotStatusListenerManager.removeListener(mGoAutopilotStatusListener)
CallerTelematicListenerManager.removeListener(TAG)
stopLoopAbnormalFactors()
}
@@ -474,8 +474,8 @@ object BusPassengerModel {
}
}
}
private val mGoAutopilotStatusListener: IMoGoAutopilotStatusListener =
object : IMoGoAutopilotStatusListener {
private val mGoAutopilotStatusListener: IOchAutopilotStatusListener =
object : IOchAutopilotStatusListener {
private var arriveAtEnd = false //乘客app专用字段
override fun onAutopilotStatusResponse(state: Int) {
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
@@ -502,7 +502,7 @@ object BusPassengerModel {
}
}
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivalNotification?) {
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivedStation?) {
if (FunctionBuildConfig.isDemoMode
&& isPassenger(FunctionBuildConfig.appIdentityMode)
) {

View File

@@ -81,20 +81,32 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
@Override
public void onAutopilotEnable() {
runOnUIThread(() -> mView.onAutopilotStatusChanged(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE));
runOnUIThread(() -> {
if(mView!=null) {
mView.onAutopilotStatusChanged(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE);
}
});
}
@Override
public void onAutopilotDisable() {
runOnUIThread(() -> mView.onAutopilotStatusChanged(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE));
runOnUIThread(() -> {
if(mView!=null) {
mView.onAutopilotStatusChanged(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE);
}
});
}
@Override
public void onAutopilotRunning() {
runOnUIThread(() -> mView.onAutopilotStatusChanged(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
runOnUIThread(() -> {
if(mView!=null) {
mView.onAutopilotStatusChanged(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING);
}
});
}
@Override
@@ -104,14 +116,20 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
@Override
public void onCarLocationChanged(MogoLocation location) {
if (location != null){
runOnUIThread(() -> mView.onCarLocationChanged(location));
}
runOnUIThread(() -> {
if(mView!=null&&location!=null) {
mView.onCarLocationChanged(location);
}
});
}
@Override
public void changeOperationStatus(boolean changeStatus) {
runOnUIThread(() -> mView.changeOperationStatus(changeStatus));
runOnUIThread(() -> {
if(mView!=null) {
mView.changeOperationStatus(changeStatus);
}
});
}
@Override
@@ -121,37 +139,65 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
@Override
public void updateDriverSn(String sn) {
runOnUIThread(() -> mView.updateDriverSn(sn));
runOnUIThread(() -> {
if(mView!=null) {
mView.updateDriverSn(sn);
}
});
}
@Override
public void updateLineInfo(String lineName, String lineDurTime) {
runOnUIThread(() -> mView.updateLineInfo(lineName, lineDurTime));
runOnUIThread(() -> {
if(mView!=null) {
mView.updateLineInfo(lineName, lineDurTime);
}
});
}
@Override
public void updateStationsInfo(List<BusStationBean> stations, int currentStationIndex, boolean isArrived) {
runOnUIThread(() -> mView.updateStationsInfo(stations,currentStationIndex, isArrived));
runOnUIThread(() -> {
if(mView!=null) {
mView.updateStationsInfo(stations, currentStationIndex, isArrived);
}
});
}
@Override
public void showNoTaskView() {
runOnUIThread(() -> mView.showNoTaskView());
runOnUIThread(() -> {
if(mView!=null) {
mView.showNoTaskView();
}
});
}
@Override
public void hideNoTaskView() {
runOnUIThread(() -> mView.hideNoTaskView());
runOnUIThread(() -> {
if(mView!=null) {
mView.hideNoTaskView();
}
});
}
@Override
public void routeResult(List<LatLng> routeArrived,List<LatLng> routeArriving,MogoLocation location) {
runOnUIThread(() ->mView.routeResult(routeArrived,routeArriving,location));
runOnUIThread(() -> {
if(mView!=null) {
mView.routeResult(routeArrived, routeArriving, location);
}
});
}
@Override
public void routePlanningToNextStationChanged(long meters, long timeInSecond) {
runOnUIThread(() -> mView.updateRoutePlanningToNextStation(meters, timeInSecond));
runOnUIThread(() -> {
if(mView!=null) {
mView.updateRoutePlanningToNextStation(meters, timeInSecond);
}
});
}
}

View File

@@ -131,6 +131,7 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
@Override
public void onDestroyView() {
mapBizView.onDestroy();
CallerTelematicListenerManager.INSTANCE.removeListener(TAG);
super.onDestroyView();
}

View File

@@ -18,14 +18,17 @@ import com.amap.api.maps.model.LatLng;
import com.elegant.utils.UiThreadHandler;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.hmi.ui.widget.DriverMonitorView;
import com.mogo.commons.storage.SharedPrefsMgr;
import com.mogo.map.overlay.IMoGoOverlayManager;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.ui.adapter.BusPassengerLineStationsAdapter;
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.common.module.utils.NumberFormatUtil;
import com.mogo.och.common.module.utils.ResourcesUtils;
import com.mogo.och.common.module.wigets.MarqueeTextView;
import com.mogo.och.common.module.wigets.OCHGradientTextView;
import com.mogo.och.data.bean.BusStationBean;
@@ -92,8 +95,8 @@ public class BusPassengerRouteFragment extends
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)});
mSpeedTv.setmColorList(new int[]{ResourcesUtils.getColor(R.color.bus_p_speed_color_start),
ResourcesUtils.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);
@@ -220,6 +223,17 @@ public class BusPassengerRouteFragment extends
}
}
@Override
public void onDestroyView() {
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
if(overlayManager!=null) {
overlayManager.removeAllLines();
overlayManager.removeAllPoints();
}
super.onDestroyView();
}
@Override
public void onDestroy() {
super.onDestroy();
@@ -368,26 +382,26 @@ public class BusPassengerRouteFragment extends
public void updateArrivedStation(String station,int currentIndex,boolean isArrived){
if (null == station){
mCurrentArriveStation.setText("----");
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveStationTitle.setText(ResourcesUtils.getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(ResourcesUtils.getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg);
handleArrivingSpeakIconDrawable();
}else {
mCurrentArriveStation.setText(station);
if (currentIndex == 0){
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveStationTitle.setText(ResourcesUtils.getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(ResourcesUtils.getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_arrived_bg);
handleArrivingSpeakIconDrawable();
return;
}
if (isArrived){
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
mCurrentArriveStationTitle.setText(ResourcesUtils.getString(R.string.bus_p_cur_station_title));
mCurrentArriveTip.setText(ResourcesUtils.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));
mCurrentArriveStationTitle.setText(ResourcesUtils.getString(R.string.bus_p_cur_next_station_title));
mCurrentArriveTip.setBackgroundResource(R.drawable.cur_station_un_arrived_bg);
handleArrivingSpeakIconDrawable();
}
@@ -427,12 +441,15 @@ public class BusPassengerRouteFragment extends
}
public void onAutopilotStatusChanged(int status) {
getActivity().runOnUiThread(() -> {
// 3. 其他过程直接更新
if (mPrevAPStatus != status){
AutopilotStatusChanged(status);
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
// 3. 其他过程直接更新
if (mPrevAPStatus != status){
AutopilotStatusChanged(status);
}
mPrevAPStatus = status;
}
mPrevAPStatus = status;
});
}

View File

@@ -20,7 +20,6 @@ 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.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.sendMsgToServer
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
@@ -32,20 +31,26 @@ import com.mogo.och.bus.passenger.bean.BusPassengerOperationStatusResponse
import com.mogo.och.bus.passenger.constant.BusPassengerConst
import com.mogo.och.bus.passenger.passenger.callback.AutoPilotStatusCallback
import com.mogo.och.bus.passenger.passenger.callback.DrivingInfoCallback
import com.mogo.och.common.module.bean.dpmsg.*
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager.pushAppOperationalMsgBox
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.socket.cloud.OCHSocketMessageManager.pushAppOperationalMsgBox
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.network.OchCommonServiceCallback
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.data.bean.BusRoutesResult
import com.mogo.och.data.bean.BusStationBean
import com.mogo.och.data.bean.BusTransferData
import com.mogo.och.bus.passenger.bean.PM2RoutesResponse
import com.mogo.och.bus.passenger.network.BusPassengerServiceManager
import com.mogo.och.common.module.manager.distancemamager.IDistanceListener
import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager
import com.mogo.och.common.module.manager.loopmanager.BizLoopManager
import com.mogo.och.common.module.manager.loopmanager.LoopInfo
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
import com.mogo.och.common.module.manager.distance.IDistanceListener
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
import com.mogo.och.common.module.manager.loop.BizLoopManager
import com.mogo.och.common.module.manager.loop.LoopInfo
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager
import com.mogo.och.common.module.manager.socket.lan.bean.AppConnectMsg
import com.mogo.och.common.module.manager.socket.lan.bean.BaseDPMsg
import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType
import com.mogo.och.common.module.manager.socket.lan.bean.TaskDetailsMsg
import com.mogo.och.common.module.utils.OCHThreadPoolManager
import kotlin.math.abs
@@ -101,12 +106,12 @@ class PM2DrivingModel private constructor() {
private fun queryDriverByLocalDriver() {
//本地去请求司机端
val msg = TaskDetailsMsg("task")
sendMsgToServer(GsonUtils.toJson(msg))
LanSocketManager.sendMsgToServer(msg)
}
private fun initListener() {
//自动驾驶状态监听
CallerAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
OchAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
// 定位监听
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, mMapLocationListener)
@@ -121,13 +126,6 @@ class PM2DrivingModel private constructor() {
TrajectoryAndDistanceManager.addDistanceListener(TAG, trajectoryListener)
}
private fun sendMsgToServer(msg: String) {
sendMsgToServer(
OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(msg).toByteArray()
)
}
fun releaseListener() {
//自动驾驶状态监听
CallerAutoPilotStatusListenerManager.removeListener(TAG)
@@ -271,8 +269,8 @@ class PM2DrivingModel private constructor() {
mDrivingInfoCallback?.updateSpeed(speedKM)
}
private val mAutoPilotStatusListener: IMoGoAutopilotStatusListener =
object : IMoGoAutopilotStatusListener {
private val mAutoPilotStatusListener: IOchAutopilotStatusListener =
object : IOchAutopilotStatusListener {
override fun onAutopilotStatusResponse(state: Int) {
super.onAutopilotStatusResponse(state)

View File

@@ -124,11 +124,12 @@ class PM2DrivingInfoFragment :
}
}
override fun onDestroy() {
super.onDestroy()
override fun onDestroyView() {
overMapView?.let{
it.onDestroy()
}
super.onDestroyView()
}
fun updateSpeed(speed: Int){

View File

@@ -2,6 +2,7 @@ package com.mogo.och.bus.passenger.passenger.ui
import android.os.Bundle
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getOverlayManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.map.overlay.core.Level
@@ -64,6 +65,10 @@ class PM2HPMapFragment :
override fun onDestroyView() {
mapBizView.onDestroy()
CallerMapUIServiceManager.getOverlayManager()?.let {
it.removeAllLines()
it.removeAllPoints()
}
super.onDestroyView()
}

View File

@@ -15,7 +15,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListene
import com.mogo.eagle.core.function.call.v2x.CallerTurnLightListenerManager
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.och.bus.passenger.R
import com.mogo.och.common.module.manager.lightmanager.TurnLightManager
import com.mogo.och.common.module.manager.light.TurnLightManager
import kotlinx.android.synthetic.main.bus_p_m2_turn_light_status.view.left_nor_image
import kotlinx.android.synthetic.main.bus_p_m2_turn_light_status.view.left_select_image
import kotlinx.android.synthetic.main.bus_p_m2_turn_light_status.view.right_nor_image
@@ -58,6 +58,7 @@ class M2TurnLightView @JvmOverloads constructor(
super.onDetachedFromWindow()
CallerChassisLamplightListenerManager.removeListener(TAG)
CallerTurnLightListenerManager.removeListener(TAG)
TurnLightManager.removeTurnLightStatusChangeListener(TAG)
}
override fun hideTurnLightView() {

View File

@@ -15,12 +15,6 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="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"
@@ -96,6 +90,8 @@
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<com.mogo.och.common.module.wigets.LoadingMapStatusView
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -22,10 +22,11 @@
<!--Wifi状态-->
<com.mogo.eagle.core.function.hmi.ui.widget.WifiStateView
android:id="@+id/wifiStateView"
android:layout_width="@dimen/dp_28"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_28"
android:layout_gravity="center"
android:layout_marginStart="@dimen/dp_40"
app:wifi_size="@dimen/dp_18"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/status_bar_logo"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -168,6 +168,7 @@
android:id="@+id/clg_distance_left_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="bg_distance_lefttime,bg_distance_lefttime_split,tv_distance,tv_left_time" />
<View

View File

@@ -137,7 +137,7 @@
android:layout_height="@dimen/dp_30"/>
<com.mogo.och.common.module.manager.xiaozhimanager.ZhiView
<com.mogo.och.common.module.manager.xiaozhi.ZhiView
android:id="@+id/zv_msg_pop_bottom"
android:layout_width="@dimen/dp_240"
android:layout_height="@dimen/dp_240"
@@ -157,6 +157,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<com.mogo.och.common.module.wigets.LoadingMapStatusView
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!-- 16 9 -->
<!-- 1000 562.5 -->
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -10,7 +10,7 @@
<!--Wifi状态-->
<com.mogo.eagle.core.function.hmi.ui.widget.WifiStateView
android:id="@+id/wifiStateView"
android:layout_width="@dimen/dp_28"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_28"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"

View File

@@ -18,7 +18,7 @@ android {
kapt {
useBuildCache = false
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
arg("AROUTER_MODULE_NAME", "charter"+project.getName())
}
}
}

View File

@@ -0,0 +1,40 @@
package com.magic.mogo.och.charter
import android.content.Context
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.magic.mogo.och.charter.fragment.DriverM1Fragment
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.biz.provider.CommonService
import com.mogo.och.common.module.biz.provider.CommonServiceImpl
/**
* @author: wangmingjun
* @date: 2023/2/22
*/
@Route(path = OchCommonConst.CHARTER_DRIVER)
class CharterDriverProvider : CommonServiceImpl() {
private val tag = CharterDriverProvider::class.java.simpleName
private var fragment: Fragment?=null
override fun getFragment(): Fragment {
CallerLogger.d(SceneConstant.M_TAXI + tag, "getFragment")
if(fragment==null){
fragment = DriverM1Fragment()
}
return fragment!!
}
override fun resetFragment() {
fragment = null
}
override fun init(context: Context) {
CallerLogger.d(SceneConstant.M_TAXI + tag, "init")
}
}

View File

@@ -1,70 +0,0 @@
package com.magic.mogo.och.charter
import android.content.Context
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.magic.mogo.och.charter.constant.CharterConst
import com.magic.mogo.och.charter.fragment.DriverM1Fragment
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
/**
* @author: wangmingjun
* @date: 2023/2/22
*/
@Route(path = CharterConst.PATH)
class CharterProvider: IMoGoFunctionProvider{
private var mActivity: FragmentActivity? = null
private var mContainerId: Int? = 0
private var driverM1Fragment: Fragment? = null
override fun createCoverage(fragmentActivity: FragmentActivity?, integer: Int?): Fragment? {
this.mContainerId = integer
this.mActivity = fragmentActivity
showFragment()
return null
}
private fun showFragment() {
val supportFragmentManager = mActivity?.supportFragmentManager
if (driverM1Fragment == null) {
d(TAG, "准备add fragment======")
val fragmentByTag = supportFragmentManager?.findFragmentByTag(DriverM1Fragment.TAG)
driverM1Fragment = if (fragmentByTag is DriverM1Fragment) {
fragmentByTag
} else {
DriverM1Fragment()
}
if (!driverM1Fragment?.isAdded!!) {
mContainerId?.let {
supportFragmentManager?.beginTransaction()
?.add(it, driverM1Fragment!!, DriverM1Fragment.TAG)?.commitAllowingStateLoss()
}
}
return
}
d(TAG, "准备show fragment")
supportFragmentManager?.beginTransaction()?.show(driverM1Fragment!!)?.commitAllowingStateLoss()
}
override fun init(context: Context?) {
}
override val functionName: String
get() = ""
override fun onDestroy() {
// 若不调用finish, 设置中打开关闭UITouch,会造成och fragment 重叠
mActivity?.finish()
}
companion object {
private val TAG = CharterProvider::class.java.simpleName
}
}

View File

@@ -1,16 +1,17 @@
package com.magic.mogo.och.charter.base
import android.animation.ObjectAnimator
import android.annotation.SuppressLint
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.animation.LinearInterpolator
import android.widget.*
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.RelativeLayout
import android.widget.TextView
import androidx.constraintlayout.widget.Group
import com.magic.mogo.och.charter.R
import com.magic.mogo.och.charter.constant.CharterConst
import com.magic.mogo.och.charter.view.SlidePanelView
import com.magic.mogo.och.charter.view.autopilot.AutopilotStatusView
import com.mogo.commons.mvp.IView
@@ -18,29 +19,25 @@ import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.mvp.Presenter
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getState
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.attachAutopilotBeforeLaunchView
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.initAiCollect
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.initBadCase
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.reportWorkOrder
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showToolsView
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView.ClickListener
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView
import com.mogo.eagle.core.function.smp.view.SmallMapView
import com.mogo.eagle.core.function.view.MapBizView
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener
import com.mogo.eagle.core.utilcode.util.ResourceUtils.getDrawable
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.map.listener.IMogoMapListener
import com.mogo.map.listener.MogoMapListenerHandler.Companion.mogoMapListenerHandler
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.och.common.module.utils.SoundPoolHelper
import kotlinx.android.synthetic.main.charter_base_fragment.*
import kotlinx.android.synthetic.main.charter_base_fragment.module_mogo_och_arrived_tv
import org.greenrobot.eventbus.EventBus
import kotlin.math.abs
/**
* @author: wangmingjun
@@ -92,6 +89,13 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
slidePanelView?.setText(resources.getString(R.string.charter_back_car))
slidePanelView?.setOnSlidePanelMoveToEndListener(onSlideToEndListener)
// mTrafficDataView = (TrafficDataView) findViewById(R.id.bus_arc);
val flSpeed = findViewById<FrameLayout>(R.id.fl_speed)
if (flSpeed != null) {
attachAutopilotBeforeLaunchView(flSpeed.context, flSpeed)
}
LayoutInflater.from(context).inflate(getStationPanelViewId(), flStationPanelContainer)
mSwitchMapModeLayout = findViewById(R.id.bus_switch_model_layout)
mSwitchMapModeImage = findViewById(R.id.bus_switch_model_icon)
@@ -157,7 +161,7 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
// mBadcaseBtn的visible显示逻辑在showBadcaseEntrance内处理
mBadcaseBtn = findViewById(R.id.module_mogo_och_badcase_rl)
if (mBadcaseBtn != null) {
initBadCase(mBadcaseBtn!!)
reportWorkOrder(mBadcaseBtn!!)
CallerAutopilotRecordListenerManager.addListener(TAG, this)
}
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl)
@@ -288,6 +292,7 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
override fun onDestroyView() {
mapBizView!!.onDestroy()
smallMapView?.onDestroy()
super.onDestroyView()
CallerAutopilotRecordListenerManager.removeListener(TAG)
EventBus.getDefault().unregister(this)
@@ -329,7 +334,6 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
override fun onDestroy() {
super.onDestroy()
smallMapView?.onDestroy()
mogoMapListenerHandler.unregisterHostMapListener(TAG)
}

View File

@@ -5,22 +5,19 @@ import android.os.Bundle
import android.os.CountDownTimer
import android.view.View.GONE
import android.view.View.VISIBLE
import com.alibaba.android.arouter.launcher.ARouter
import com.magic.mogo.och.charter.R
import com.magic.mogo.och.charter.base.CharterBaseFragment
import com.magic.mogo.och.charter.bean.QueryCurrentOrderResponse
import com.magic.mogo.och.charter.bean.QueryCurrentOrderResponse.Result.Companion.ARRIVING
import com.magic.mogo.och.charter.constant.CharterConst.Companion.LOOP_PERIOD_60S
import com.magic.mogo.och.charter.net.login.LoginDriverM1Impl
import com.magic.mogo.och.charter.presenter.DriverM1Presenter
import com.magic.mogo.och.charter.view.SlidePanelView
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.temp.EventLogout
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.provider.LoginService
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.common.module.utils.createQRCodeWithPicture
import com.mogo.och.common.module.wigets.BindQRCodeDialog
@@ -47,7 +44,6 @@ import kotlin.math.roundToInt
*/
class DriverM1Fragment : CharterBaseFragment<DriverM1Fragment?, DriverM1Presenter?>(),
SlidePanelView.OnSlidePanelMoveToEndListener{
private var loginService: LoginService? = null
private var ochCommitDialog: OCHCommitDialog? = null
var countDownTimer: CountDownTimer? = null
@@ -57,11 +53,6 @@ class DriverM1Fragment : CharterBaseFragment<DriverM1Fragment?, DriverM1Presente
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
loginService =
ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation() as LoginService
if (loginService != null) {
loginService?.registerFragment(this, presenter, LoginDriverM1Impl())
}
}
private fun showOrHideOrderUI(show:Boolean){
@@ -118,9 +109,14 @@ class DriverM1Fragment : CharterBaseFragment<DriverM1Fragment?, DriverM1Presente
}
override fun onDestroyView() {
if (mPresenter != null) {
mPresenter?.onDestroy(this)
}
CallerMapUIServiceManager.getOverlayManager()?.let {
it.removeAllLines()
it.removeAllPoints()
}
super.onDestroyView()
loginService?.unRegisterFragment()
loginService = null
}
@Subscribe(threadMode = ThreadMode.MAIN)

View File

@@ -14,7 +14,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager;
import java.util.HashMap;

Some files were not shown because too many files have changed in this diff Show More