[2.13.0-arch-opt] hmi proxy replace to view

This commit is contained in:
zhongchao
2023-01-29 16:24:45 +08:00
parent 79ac7817be
commit 8433d0c8de
26 changed files with 468 additions and 449 deletions

View File

@@ -22,7 +22,6 @@ import androidx.constraintlayout.widget.Group;
import com.mogo.commons.mvp.IView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.config.HmiBuildConfig;
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;
@@ -30,7 +29,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.hmi.ui.setting.SOPSettingView;
import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
@@ -189,9 +187,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
if (mBadcaseBtn != null) {
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn);
if (!HmiBuildConfig.isShowBadCaseView) {
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
}
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
}
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl);
@@ -230,9 +226,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
@Override
public void onDestroyView() {
super.onDestroyView();
if (!HmiBuildConfig.isShowBadCaseView) {
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
}
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
EventBus.getDefault().unregister(this);
}

View File

@@ -3,14 +3,14 @@ package com.mogo.och.noop
import android.view.View
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
import com.mogo.och.bus.R
import kotlinx.android.synthetic.main.fragment_hmi.*
@@ -35,41 +35,35 @@ class OchNoopFragment : MvpFragment<OchNoopContract.View?, OchNoopPresenter?>(),
override fun initViews() {
//设置StatusBar初始状态
CallerHmiViewControlListenerManager.updateStatusBarRightView(
StatusBarView.TAG,
FunctionBuildConfig.isDemoMode,
"demoMode",
DemoModeView(requireContext())
)
ivCameraIcon?.setOnClickListener {
cameraLiveView.showCameraList(context, CallerFuncBizManager.bizProvider.getCameraList){ liveStatus ->
if(liveStatus){
cameraLiveView.showCameraList(
context,
CallerFuncBizManager.bizProvider.getCameraList
) { liveStatus ->
if (liveStatus) {
ivCameraIcon.setBackgroundResource(R.drawable.icon_camera_selected)
}else{
} else {
ivCameraIcon.setBackgroundResource(R.drawable.icon_camera_nor)
}
}
}
ivToolsIcon?.setOnClickListener {
ivToolsView?.setOnClickListener {
toolsView.showToolsFloat(context)
}
//美化模式隐藏开关
viewDemoModeSwitch.setOnClickListener {
//只在司机端设置美化模式开关功能
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
//单次查询,是否有行程信息(订单进行中时点击不生效),autopilotControlParameters为null代表不处于自动驾驶状态下
if (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().autopilotControlParameters == null) {
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
context?.let {
CallerHmiManager.updateStatusBarLeftView(
FunctionBuildConfig.isDemoMode,
"demoMode",
DemoModeView(it)
)
}
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
if (!FunctionBuildConfig.isDemoMode) {
//关闭美化模式时,通知工控机
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
}
}
}
viewShowDebugView.setOnLongClickListener {
ToggleDebugView.toggleDebugView.toggle(requireContext())
true
}
cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
@@ -99,16 +93,6 @@ class OchNoopFragment : MvpFragment<OchNoopContract.View?, OchNoopPresenter?>(),
}
}
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
cbMsgBoxDriver.visibility = View.VISIBLE
viewDriverMsgBoxBubble.visibility = View.VISIBLE
}
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)
) {
cbMsgBoxPassenger.visibility = View.VISIBLE
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
}
}

View File

@@ -39,14 +39,15 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--Vip车辆标志-->
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
android:id="@+id/flVipIdentificationView"
android:layout_width="@dimen/module_vip_width"
android:layout_height="@dimen/module_vip_height"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--接管提示-->
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
android:id="@+id/clTakeOverView"
android:layout_width="@dimen/hmi_take_over_request_width"
@@ -69,13 +70,12 @@
app:layout_goneMarginStart="@dimen/module_mogo_autopilot_status_margin_left" />
<!--超视距-->
<ImageView
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
android:id="@+id/ivCameraIcon"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginTop="45dp"
android:layout_marginEnd="40dp"
android:background="@drawable/icon_camera_nor"
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
@@ -101,7 +101,8 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<View
<!--隐藏态下的 美化模式按钮-->
<com.mogo.eagle.core.function.hmi.ui.switch.DemoModeHiddenSwitch
android:id="@+id/viewDemoModeSwitch"
android:layout_width="120dp"
android:layout_height="100dp"
@@ -111,16 +112,13 @@
app:layout_constraintStart_toStartOf="parent" />
<!--工具箱-->
<ImageView
android:id="@+id/ivToolsIcon"
<com.mogo.eagle.core.function.hmi.ui.tools.ToolsImageView
android:id="@+id/ivToolsView"
android:layout_width="@dimen/module_hmi_check_size"
android:layout_height="@dimen/module_hmi_check_size"
android:layout_marginLeft="25dp"
android:layout_marginStart="25dp"
android:layout_marginBottom="40dp"
android:background="@drawable/module_ext_check"
android:elevation="@dimen/dp_10"
android:scaleType="center"
android:src="@drawable/icon_tools_nor"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/viewPerspectiveSwitch"
app:layout_goneMarginStart="50dp" />
@@ -134,7 +132,7 @@
android:layout_marginBottom="40dp"
android:src="@drawable/bad_case_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/ivToolsIcon" />
app:layout_constraintStart_toEndOf="@id/ivToolsView" />
<ImageView
android:id="@+id/ivAiCollectTools"
@@ -153,7 +151,7 @@
android:background="@drawable/version_upgrade_tips_background"
android:translationZ="30dp"
android:visibility="gone"
app:layout_constraintCircle="@id/ivToolsIcon"
app:layout_constraintCircle="@id/ivToolsView"
app:layout_constraintCircleAngle="45"
app:layout_constraintCircleRadius="60dp"
tools:ignore="MissingConstraints" />
@@ -187,7 +185,7 @@
android:layout_marginEnd="25dp"
android:background="@drawable/selector_msg_box"
android:button="@null"
android:visibility="gone"
android:visibility="visible"
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />
@@ -244,7 +242,7 @@
android:layout_width="864px"
android:layout_height="wrap_content"
android:layout_marginEnd="40dp"
android:visibility="gone"
android:visibility="visible"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver" />
@@ -288,6 +286,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View File

@@ -23,7 +23,6 @@ import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.mvp.IView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.config.HmiBuildConfig;
import com.mogo.eagle.core.data.constants.DataTypes;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
@@ -32,7 +31,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -45,9 +43,9 @@ import com.mogo.och.sweeper.R;
import com.mogo.och.sweeper.bean.SweeperRoutesResult;
import com.mogo.och.sweeper.constant.SweeperConst;
import com.mogo.och.sweeper.model.SweeperOrderModel;
import com.mogo.och.sweeper.view.SweeperTrafficDataView;
import com.mogo.och.sweeper.util.BDRouteDataTestUtils;
import com.mogo.och.sweeper.view.SlidePanelView;
import com.mogo.och.sweeper.view.SweeperTrafficDataView;
import mogo.telematics.pad.MessagePad;
import record_cache.RecordPanelOuterClass;
@@ -215,9 +213,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
if (mBadcaseBtn != null) {
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn);
if (!HmiBuildConfig.isShowBadCaseView) {
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
}
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
}
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl);
@@ -246,9 +242,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
@Override
public void onDestroyView() {
super.onDestroyView();
if (!HmiBuildConfig.isShowBadCaseView) {
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
}
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
}

View File

@@ -49,7 +49,7 @@ import java.lang.ref.WeakReference;
* @author tongchenfei
*/
public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFragment, BaseTaxiPassengerPresenter>
implements IMogoMapListener, TaxiPassengerTaxiView, ITPClickStartAutopilotCallback, IMoGoHmiViewProxy.IViewNotificationProvider {
implements IMogoMapListener, TaxiPassengerTaxiView, ITPClickStartAutopilotCallback{
static final String TAG = "TaxiPassengerBaseFragment";
@@ -91,8 +91,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
mTrafficLightView = findViewById(R.id.traffic_light_view);
CallerHmiManager.INSTANCE.setProxyTrafficLightView(mTrafficLightView);
CallerHmiManager.INSTANCE.setNotificationViewProvider(this);
mMapswitchBtn = findViewById(R.id.module_och_taxi_swich_map_iv);
updateSwitchMapIcon();
initListener();
@@ -104,12 +102,6 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
EmptyService.Companion.startService(getContext());
}
@NonNull
@Override
public IViewNotification getNotificationView() {
return new TaxiPassengerV2XNotificationView(getContext());
}
private void updateSwitchMapIcon() {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {

View File

@@ -24,7 +24,6 @@ import androidx.fragment.app.FragmentTransaction;
import com.mogo.commons.mvp.IView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.config.HmiBuildConfig;
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;
@@ -202,9 +201,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
mBadcaseBtn = findViewById(R.id.module_och_taxi_badcase_ll);
if (mBadcaseBtn != null) {
CallerDevaToolsManager.INSTANCE.initBadCase(mBadcaseBtn);
if (!HmiBuildConfig.isShowBadCaseView) {
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
}
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
}
mAICollectBtn = findViewById(R.id.module_och_taxi_ai_collect_ll);
@@ -292,9 +289,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
@Override
public void onDestroyView() {
super.onDestroyView();
if (!HmiBuildConfig.isShowBadCaseView) {
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
}
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
}
@Override