[功能界面调整]
This commit is contained in:
yangyakun
2024-05-13 19:05:13 +08:00
parent 5bb81e85f8
commit dc13e5690a
116 changed files with 750 additions and 1181 deletions

View File

@@ -11,7 +11,6 @@ import android.view.ViewGroup;
import android.view.animation.LinearInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -26,21 +25,13 @@ 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;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView;
import com.mogo.eagle.core.function.smp.view.SmallMapView;
import com.mogo.eagle.core.function.view.MapBizView;
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.listener.MogoMapListenerHandler;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.och.bus.R;
import com.mogo.och.bus.bean.BusRoutesResult;
import com.mogo.och.bus.model.OrderModel;
@@ -52,10 +43,6 @@ import com.mogo.och.common.module.utils.ResourcesUtils;
import org.greenrobot.eventbus.EventBus;
import bag_manager.BagManagerOuterClass;
import mogo.telematics.pad.MessagePad;
import record_cache.RecordPanelOuterClass;
/**
* 网约车基础Fragment主要负责布局通用界面处理站点面板和通话面板互斥情况
* <p>
@@ -63,7 +50,7 @@ import record_cache.RecordPanelOuterClass;
*
* @author tongchenfei
*/
public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener {
public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> {
private static final String TAG = "BaseBusTabFragment";
@@ -72,17 +59,9 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
private ImageView ctvAutopilotStatusIv;
private TextView ctvAutopilotStatusTv;
protected TextView tvArrived;
protected RelativeLayout mSettingBtn;
protected RelativeLayout mBadcaseBtn;
private FrameLayout flStationPanelContainer;
private BizMapView mapBizView;
private Group groupTestPanel;
// private TrafficDataView mTrafficDataView;
// private BusTrafficLightView mTrafficLightView;
//远景和中景的切换
private ImageView mSwitchMapModeImage;
private LinearLayout mSwitchMapModeLayout;
protected SmallMapView smallMapView;
@@ -140,34 +119,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer);
slidePanelView.setOnSlidePanelMoveToEndListener(onSlideToEndListener);
mSwitchMapModeLayout = findViewById(R.id.bus_switch_model_layout);
mSwitchMapModeImage = findViewById(R.id.bus_switch_model_icon);
updateSwitchMapIcon();
mSwitchMapModeLayout.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl(View v) {
if(mapBizView != null){
IMogoMapUIController uiController = mapBizView.getUI();
if(uiController != null){
//切换地图的远近视图
if (uiController.getCurrentMapVisualAngle().isLongSight()) {
uiController.setLockMode(true);
uiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else if (uiController.getCurrentMapVisualAngle().isMediumSight()) {
uiController.setLockMode(false);
uiController.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else {
uiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
}
}
}
}
});
initListener();
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(), CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
ctvAutopilotStatus.setOnClickListener(new OnPreventFastClickListener() {
@@ -208,18 +159,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
onArriveStation();
});
mSettingBtn = findViewById(R.id.module_mogo_och_setting_layout);
mSettingBtn.setOnClickListener(v -> {
CallerHmiManager.INSTANCE.showToolsView();
});
// mBadcaseBtn的visible显示逻辑在showBadcaseEntrance内处理
mBadcaseBtn = findViewById(R.id.module_mogo_och_badcase_rl);
if (mBadcaseBtn != null) {
CallerDevaToolsManager.INSTANCE.reportWorkOrder(mBadcaseBtn);
}
//消息盒子
viewDriverMsgBoxButton = findViewById(R.id.viewDriverMsgBoxButton);
viewDriverMsgBoxList = findViewById(R.id.viewDriverMsgBoxList);
@@ -264,21 +203,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
protected abstract void onArriveStation();
private void updateSwitchMapIcon() {
if(mapBizView != null){
IMogoMapUIController uiController = mapBizView.getUI();
if(uiController != null){
if (uiController.getCurrentMapVisualAngle().isLongSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else if (uiController.getCurrentMapVisualAngle().isMediumSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
}
}
}
}
private void debugArrivedRoute() {
BDRouteDataTestUtils.converToRouteData();
}
@@ -308,7 +232,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
if(smallMapView != null){
smallMapView.onDestroy();
}
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
EventBus.getDefault().unregister(this);
super.onDestroyView();
}
@@ -319,7 +242,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
protected abstract void debugArrivedStation();
private void initListener() {
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, this);
}
/**
@@ -539,31 +461,9 @@ 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);
// }
// }
@Override
public void onDestroy() {
super.onDestroy();
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG);
}
@Override
public void onMapVisualAngleChanged(VisualAngleMode visualAngleMode) {
if (visualAngleMode.isMediumSight()) {
mSwitchMapModeLayout.setVisibility(View.VISIBLE);
} else if (visualAngleMode.isLongSight()) {
mSwitchMapModeLayout.setVisibility(View.VISIBLE);
} else if (visualAngleMode.isCloseSight()) {
mSwitchMapModeLayout.setVisibility(View.GONE);
}
}
/**

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/icon_ai_select" android:state_focused="true" android:state_pressed="true" />
<item android:drawable="@drawable/icon_ai_select" android:state_focused="false" android:state_pressed="true" />
<item android:drawable="@drawable/icon_ai_select" android:state_selected="true" />
<item android:drawable="@drawable/icon_ai_select" android:state_focused="true" />
<item android:drawable="@drawable/icon_ai_normal" />
</selector>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/icon_bad_case_select" android:state_focused="true" android:state_pressed="true" />
<item android:drawable="@drawable/icon_bad_case_select" android:state_focused="false" android:state_pressed="true" />
<item android:drawable="@drawable/icon_bad_case_select" android:state_selected="true" />
<item android:drawable="@drawable/icon_bad_case_select" android:state_focused="true" />
<item android:drawable="@drawable/icon_bad_case_normal" />
</selector>

View File

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

View File

@@ -6,11 +6,13 @@
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_72">
<!-- 高精地图 -->
<com.mogo.och.bus.view.BizMapView
android:id="@+id/mapBizView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- 打开调试窗口 -->
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_100"
@@ -19,6 +21,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!-- 展示速度、档位、方向盘、刹车、加速度 -->
<FrameLayout
android:id="@+id/fl_speed"
android:layout_width="@dimen/dp_618"
@@ -106,8 +109,8 @@
<!--消息盒子选择入口-->
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
android:id="@+id/viewDriverMsgBoxButton"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"
android:layout_marginTop="15dp"
android:layout_marginEnd="25dp"
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
@@ -152,6 +155,7 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- 自动驾驶状态 -->
<RelativeLayout
android:id="@+id/module_mogo_och_autopilot_status"
android:layout_width="@dimen/dp_616"
@@ -187,6 +191,7 @@
</RelativeLayout>
<!-- 站点信息页面 -->
<FrameLayout
android:id="@+id/module_mogo_och_station_panel_container"
android:layout_width="wrap_content"
@@ -196,7 +201,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
/>
<!--订单调试页面-->
<include
android:id="@+id/module_mogo_och_bus_test_bar"
layout="@layout/bus_test_bar_view"
@@ -207,96 +212,59 @@
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_station_panel_container"
tools:visibility="visible" />
<!--切换地图远近事件 @dimen/module_switch_map -->
<LinearLayout
android:id="@+id/bus_switch_model_layout"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_arrived_tv"
app:layout_constraintLeft_toRightOf="@+id/module_mogo_och_arrived_tv"
app:layout_goneMarginBottom="@dimen/module_mogo_och_margin_bottom"
app:layout_goneMarginLeft="@dimen/module_mogo_och_margin_left">
<ImageView
android:id="@+id/bus_switch_model_icon"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80" />
</LinearLayout>
<!-- <CheckedTextView-->
<!-- android:id="@+id/module_mogo_och_operation_status"-->
<!-- android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"-->
<!-- android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"-->
<!-- android:background="@drawable/bus_operation_status_bg"-->
<!-- android:elevation="@dimen/dp_10"-->
<!-- android:gravity="center"-->
<!-- android:text="出车"-->
<!-- android:textAlignment="center"-->
<!-- android:textColor="@color/bus_autopilot_text_color_selector"-->
<!-- android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"-->
<!-- android:textStyle="bold"-->
<!-- android:layout_marginLeft="@dimen/module_mogo_och_margin_left"-->
<!-- android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"/>-->
<TextView
android:id="@+id/module_mogo_och_arrived_tv"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"
android:layout_marginBottom="@dimen/dp_16"
android:layout_marginStart="@dimen/dp_19"
android:background="@drawable/common_arrive_station_selector"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:text="@string/bus_arrived_str"
android:textColor="@color/bus_autopilot_text_color_selector"
android:textSize="@dimen/module_mogo_och_arrived_text_size"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<RelativeLayout
android:id="@+id/module_mogo_och_setting_layout"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg"
android:elevation="@dimen/dp_10"
<com.mogo.och.common.module.wigets.map.toolsview.ToolsView
android:id="@+id/toolsView"
android:layout_marginStart="-10dp"
android:layout_marginBottom="@dimen/dp_17"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/bus_switch_model_layout">
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_arrived_tv"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"/>
<ImageView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:background="@drawable/bus_setting_btn_bg" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/module_mogo_och_badcase_rl"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg_selector"
<!--切换地图远近事件 @dimen/module_switch_map -->
<com.mogo.och.common.module.wigets.map.switchvisual.VisualView
android:id="@+id/switch_visual_view"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout">
app:layout_constraintLeft_toRightOf="@id/toolsView"
android:layout_marginStart="-10dp"
android:layout_marginBottom="@dimen/dp_17"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"/>
<ImageView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:src="@drawable/icon_bad_case" />
</RelativeLayout>
<com.mogo.eagle.core.function.hmi.ui.widget.RomaBusView
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
app:layout_constraintBottom_toBottomOf="@id/module_mogo_och_badcase_rl"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl"
app:layout_constraintTop_toTopOf="@id/module_mogo_och_badcase_rl"
app:roma_close_bg="@drawable/bus_operation_status_bg"
app:roma_open_bg="@drawable/bus_operation_status_select_bg" />
<com.mogo.och.common.module.wigets.map.reportworkorder.ReportWorkOrderView
android:id="@+id/reportworkorderview"
android:layout_marginStart="-10dp"
android:layout_marginBottom="@dimen/dp_17"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/switch_visual_view"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"/>
<com.mogo.eagle.core.function.hmi.ui.widget.RomaTaxiView
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="-10dp"
android:layout_marginBottom="@dimen/dp_17"
app:layout_constraintLeft_toRightOf="@id/reportworkorderview"
app:roma_close_bg="@drawable/common_driverroma_normal"
app:roma_open_bg="@drawable/common_driver_roma_press" />
<com.mogo.eagle.core.function.hmi.ui.widget.RomaDistanceView
android:layout_width="wrap_content"

View File

@@ -6,9 +6,6 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
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
@@ -17,13 +14,9 @@ import com.magic.mogo.och.charter.view.autopilot.AutopilotStatusView
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.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
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.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
@@ -31,10 +24,6 @@ import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
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.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.module_mogo_och_arrived_tv
import org.greenrobot.eventbus.EventBus
@@ -48,21 +37,15 @@ import org.greenrobot.eventbus.EventBus
* @author tongchenfei
*/
abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
MvpFragment<V, P>(), IMogoMapListener, IMoGoAutopilotRecordListener {
MvpFragment<V, P>() {
private val TAG = "BaseBusTabFragment"
private var ctvAutopilotStatus: AutopilotStatusView? = null
protected var mSettingBtn: RelativeLayout? = null
protected var mBadcaseBtn: RelativeLayout? = null
protected var mAICollectBtn: RelativeLayout? = null
private var flStationPanelContainer: FrameLayout? = null
private var mapBizView: MapBizView? = null
private var groupTestPanel: Group? = null
protected var slidePanelView: SlidePanelView? = null
//远景和中景的切换
private var mSwitchMapModeImage: ImageView? = null
private var mSwitchMapModeLayout: LinearLayout? = null
protected var smallMapView: SmallMapView? = null
@@ -90,36 +73,13 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
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)
updateSwitchMapIcon()
mSwitchMapModeLayout!!.setOnClickListener(object : OnPreventFastClickListener() {
override fun onClickImpl(v: View) {
mapBizView?.let {
it.getUI()?.let { ui ->
if (ui.currentMapVisualAngle.isLongSight) {
ui.setLockMode(true)
ui.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
mSwitchMapModeImage!!.setImageResource(R.drawable.charter_switch_map_medium)
} else if (ui.currentMapVisualAngle.isMediumSight) {
ui.setLockMode(false)
ui.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
mSwitchMapModeImage!!.setImageResource(R.drawable.charter_switch_map_long)
} else {
ui.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
mSwitchMapModeImage!!.setImageResource(R.drawable.charter_switch_map_medium)
}
}
}
}
})
initListener()
// 模拟 不可自动驾驶目前场景是刚开机adas还未和工控机连接
@@ -153,21 +113,6 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
onArriveStation()
}
mSettingBtn = findViewById(R.id.module_mogo_och_setting_layout)
mSettingBtn!!.setOnClickListener { v: View? ->
showToolsView()
}
// mBadcaseBtn的visible显示逻辑在showBadcaseEntrance内处理
mBadcaseBtn = findViewById(R.id.module_mogo_och_badcase_rl)
if (mBadcaseBtn != null) {
reportWorkOrder(mBadcaseBtn!!)
CallerAutopilotRecordListenerManager.addListener(TAG, this)
}
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl)
if (mAICollectBtn != null) {
initAiCollect(mAICollectBtn!!)
}
//消息盒子
viewDriverMsgBoxButton = findViewById(R.id.viewDriverMsgBoxButton)
viewDriverMsgBoxList = findViewById(R.id.viewDriverMsgBoxList)
@@ -260,20 +205,6 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
requireActivity().runOnUiThread { slidePanelView?.visibility = View.GONE }
}
private fun updateSwitchMapIcon() {
mapBizView?.let {
it.getUI()?.let { ui ->
if (ui.currentMapVisualAngle.isLongSight) {
mSwitchMapModeImage!!.setImageResource(R.drawable.charter_switch_map_long)
} else if (ui.currentMapVisualAngle.isMediumSight) {
mSwitchMapModeImage!!.setImageResource(R.drawable.charter_switch_map_medium)
} else {
mSwitchMapModeImage!!.setImageResource(R.drawable.charter_switch_map_medium)
}
}
}
}
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
mapBizView!!.onSaveInstanceState(outState)
@@ -299,7 +230,6 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
}
private fun initListener() {
mogoMapListenerHandler.registerHostMapListener(TAG, this)
}
@@ -334,17 +264,6 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
override fun onDestroy() {
super.onDestroy()
mogoMapListenerHandler.unregisterHostMapListener(TAG)
}
override fun onMapVisualAngleChanged(visualAngleMode: VisualAngleMode) {
if (visualAngleMode.isMediumSight) {
mSwitchMapModeLayout!!.visibility = View.VISIBLE
} else if (visualAngleMode.isLongSight) {
mSwitchMapModeLayout!!.visibility = View.VISIBLE
} else if (visualAngleMode.isCloseSight) {
mSwitchMapModeLayout!!.visibility = View.GONE
}
}
/**
@@ -370,43 +289,6 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
private var stopMd5TV: TextView? = null
private var trajMd5DPQPTV: TextView? = null
private var stopMd5DPQPTV: TextView? = null
// open fun showHideTestBar() {
// if (busTestBar == null) {
// busTestBar = findViewById(R.id.module_mogo_och_bus_test_bar)
// lineIdTV = findViewById(R.id.bus_test_bar_current_line_id)
// trajMd5TV = findViewById(R.id.bus_test_bar_current_traj_md5)
// stopMd5TV = findViewById(R.id.bus_test_bar_current_stop_md5)
// trajMd5DPQPTV = findViewById(R.id.bus_test_bar_current_traj_md5_dpqp)
// stopMd5DPQPTV = findViewById(R.id.bus_test_bar_current_stop_md5_dpqp)
// }
// if (busTestBar!!.visibility == View.VISIBLE) {
// busTestBar!!.visibility = View.GONE
// } else {
// val routesResult: BusRoutesResult = BusOrderModel.getInstance().getBusRoutesResult()
// lineIdTV!!.text = "lineId:" + (routesResult.lineId.toString() ?: "")
// trajMd5TV!!.text = "TMd5:" + routesResult.csvFileMd5
// stopMd5TV!!.text = "SMd5:" + routesResult.txtFileMd5
// trajMd5DPQPTV!!.text =
// "TMd5DPQP:" + routesResult.csvFileMd5DPQP
// stopMd5DPQPTV!!.text =
// "SMd5DPQP:" + routesResult.txtFileMd5DPQP
// busTestBar!!.visibility = View.VISIBLE
// }
// }
// open fun updateBusTestBarInfo() {
// if (busTestBar != null && busTestBar!!.visibility == View.VISIBLE) {
// val routesResult: BusRoutesResult = BusOrderModel.getInstance().busRoutesResult
// lineIdTV!!.text = "lineId:" + (routesResult?.lineId?.toString() ?: "")
// trajMd5TV!!.text = "TMd5:" + if (routesResult == null) "" else routesResult.csvFileMd5
// stopMd5TV!!.text = "SMd5:" + if (routesResult == null) "" else routesResult.txtFileMd5
// trajMd5DPQPTV!!.text =
// "TMd5DPQP:" + if (routesResult == null) "" else routesResult.csvFileMd5DPQP
// stopMd5DPQPTV!!.text =
// "SMd5DPQP:" + if (routesResult == null) "" else routesResult.txtFileMd5DPQP
// }
// }
/**
* END
*/

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

View File

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

View File

@@ -116,8 +116,8 @@
<!--消息盒子选择入口-->
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
android:id="@+id/viewDriverMsgBoxButton"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"
android:layout_marginTop="15dp"
android:layout_marginEnd="25dp"
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
@@ -196,87 +196,51 @@
app:layout_constraintLeft_toLeftOf="@id/module_mogo_och_station_panel_container"
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_station_panel_container"
tools:visibility="visible" />
<!--进站按钮-->
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/module_mogo_och_arrived_tv"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/charter_operation_status_bg"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"
android:layout_marginBottom="@dimen/dp_16"
android:layout_marginStart="@dimen/dp_19"
android:background="@drawable/common_arrive_station_selector"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:text="@string/charter_arrived_str"
android:textColor="@color/charter_autopilot_text_color_selector"
android:textSize="@dimen/dp_32"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<com.mogo.och.common.module.wigets.map.toolsview.ToolsView
android:id="@+id/toolsView"
android:layout_marginStart="-10dp"
android:layout_marginBottom="@dimen/dp_17"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_arrived_tv"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"/>
<!--切换地图远近事件 @dimen/module_switch_map -->
<LinearLayout
android:id="@+id/bus_switch_model_layout"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/charter_operation_status_bg"
android:gravity="center"
android:orientation="horizontal"
<com.mogo.och.common.module.wigets.map.switchvisual.VisualView
android:id="@+id/switch_visual_view"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent">
app:layout_constraintLeft_toRightOf="@id/toolsView"
android:layout_marginStart="-10dp"
android:layout_marginBottom="@dimen/dp_17"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"/>
<ImageView
android:id="@+id/bus_switch_model_icon"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80" />
</LinearLayout>
<!--设置信息-->
<RelativeLayout
android:id="@+id/module_mogo_och_setting_layout"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/charter_operation_status_bg"
<com.mogo.och.common.module.wigets.map.reportworkorder.ReportWorkOrderView
android:id="@+id/reportworkorderview"
android:layout_marginStart="-10dp"
android:layout_marginBottom="@dimen/dp_17"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/bus_switch_model_layout">
<ImageView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:background="@drawable/charter_setting_btn_bg" />
</RelativeLayout>
<!--异常上报-->
<RelativeLayout
android:id="@+id/module_mogo_och_badcase_rl"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/charter_operation_status_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout">
<ImageView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:src="@drawable/charter_bad_case" />
</RelativeLayout>
<!--AI数据采集-->
<RelativeLayout
android:id="@+id/module_mogo_och_ai_collet_rl"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/charter_operation_status_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl">
<ImageView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:src="@drawable/charter_ai_collect" />
</RelativeLayout>
app:layout_constraintLeft_toRightOf="@id/switch_visual_view"
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"/>
<Button
android:id="@+id/btnAutopilotDisable"

View File

@@ -1,5 +1,6 @@
package com.mogo.och.biz.login.ui
import android.content.res.Configuration
import android.view.View
import androidx.appcompat.widget.AppCompatTextView
import androidx.constraintlayout.widget.ConstraintLayout
@@ -8,6 +9,8 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.util.DeviceUtils
import com.mogo.eagle.core.utilcode.util.ScreenUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.biz.BuildConfig
import com.mogo.och.biz.R
@@ -35,22 +38,33 @@ class LoginPassengerFragment : MvpFragment<LoginPassengerFragment?, LoginPasseng
private val statusList = mutableListOf<String>()
override fun getLayoutId(): Int {
if (AppIdentityModeUtils.isM1(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isPassenger((FunctionBuildConfig.appIdentityMode))
) {
return R.layout.biz_login_passenger_view_1920x1080
} else if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isPassenger((FunctionBuildConfig.appIdentityMode))
) {
return R.layout.biz_login_passenger_view_1920x1080
} else if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode) &&
AppIdentityModeUtils.isPassenger((FunctionBuildConfig.appIdentityMode))
) {
return R.layout.biz_login_passenger_view_1080x1920
} else {
if(DeviceUtils.isLenovoModel()){
if (ScreenUtils.getScreenWidth()==2560) {
return R.layout.biz_login_passenger_view_2560x1600
}else{
if(ScreenUtils.getScreenWidth()==1920||ScreenUtils.getScreenHeight()==1920){
if(ScreenUtils.isLandscape()){// 横屏
return R.layout.biz_login_passenger_view_1920x1080
}
if(ScreenUtils.isPortrait()){// 竖屏
return R.layout.biz_login_passenger_view_1080x1920
}
}else{
return R.layout.biz_login_passenger_view_2560x1600
}
}
}else if(DeviceUtils.isEB5Model()){
if(ScreenUtils.isLandscape()){// 横屏
return R.layout.biz_login_passenger_view_1920x1080
}
if(ScreenUtils.isPortrait()){// 竖屏
return R.layout.biz_login_passenger_view_1080x1920
}
}else if(DeviceUtils.isEmulator()){
return R.layout.biz_login_passenger_view_2560x1600
}
return R.layout.biz_login_passenger_view_2560x1600
}
override fun initViews() {
@@ -125,4 +139,9 @@ class LoginPassengerFragment : MvpFragment<LoginPassengerFragment?, LoginPasseng
}
}
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
CallerLogger.d(TAG, newConfig)
}
}

View File

@@ -22,6 +22,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02Lis
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
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
@@ -55,6 +56,7 @@ object DebugDataDispatch {
const val stateAutopilotFail = "stateAutopilotFail"
const val stopSite = "stopSite"
const val v2N = "xiaozhiV2N"
const val romal = "romal"
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "location" --es path "1111/11111"
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "globalPath" --es path "sy73.json"
@@ -66,6 +68,7 @@ object DebugDataDispatch {
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "trajectoryStation" --ef startLon 116.74053643938474 --ef startLat 40.200487993233246 --ef endLon 116.73876977409685 --ef endLat 40.20179054129441 --el lineID 8
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "stopSite" --ei state 6 --ei action 1
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "xiaozhiV2N" --es poiType "10002" --ei state 0
// adb shell am broadcast -a com.mogo.launcher.debug -f 0x011000000 --es type "romal" --ei show 0
val ROOT_PATH =
@@ -167,6 +170,10 @@ object DebugDataDispatch {
pncAction.parkScenarioAction = planningaction.build()
CallerPlanningActionsListenerManager.invokePNCActions(pncAction.build())
}
romal ->{
val state = intent.getIntExtra("show", 0)
CallerMapRomaListener.invokeMapRomaRange(state==0)
}
v2N ->{
val state = intent.getIntExtra("state", 0)
val poiType = intent.getStringExtra("poiType")
@@ -178,6 +185,7 @@ object DebugDataDispatch {
}
}
}
else -> {}
}
}

View File

@@ -0,0 +1,56 @@
package com.mogo.och.common.module.wigets.map.orderstatus
import android.content.Context
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatImageView
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.findViewTreeViewModelStoreOwner
import com.mogo.och.common.module.R
/**
*
*/
class OrderStatusView : AppCompatImageView, OrderStatusViewModel.IVisualCallback {
private val TAG = "VisualView"
constructor(context: Context) : super(context)
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(
context,
attributeSet,
defStyleAttr
)
private fun initView() {
setImageResource(R.drawable.common_visual_medium)
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
val viewModel = findViewTreeViewModelStoreOwner()?.let {
ViewModelProvider(it).get(OrderStatusViewModel::class.java)
}
viewModel?.setDistanceCallback(this)
}
init {
try {
initView()
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun setImageViewResource(name: Int) {
setImageResource(name)
}
}

View File

@@ -0,0 +1,47 @@
package com.mogo.och.common.module.wigets.map.orderstatus
import androidx.annotation.DrawableRes
import androidx.lifecycle.ViewModel
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.common.module.R
import com.mogo.och.common.module.biz.login.ILoginCallback
import com.mogo.och.common.module.biz.login.LoginStatusManager
import com.mogo.och.common.module.biz.login.OpenOrderStatusEnum
class OrderStatusViewModel : ViewModel(), ILoginCallback {
private val TAG = OrderStatusViewModel::class.java.simpleName
private var viewCallback: IVisualCallback? = null
init {
}
override fun onCleared() {
super.onCleared()
LoginStatusManager.removeListener(TAG)
this.viewCallback = null
}
fun setDistanceCallback(viewCallback: IVisualCallback) {
LoginStatusManager.addListener(TAG, this)
this.viewCallback = viewCallback
}
override fun onOpenOrderStatusEnumChange(businessEnum: OpenOrderStatusEnum?) {
UiThreadHandler.post({
if (LoginStatusManager.isOpenOrderType()) {
this.viewCallback?.setImageViewResource(R.drawable.common_status_ordinging)
} else {
this.viewCallback?.setImageViewResource(R.drawable.common_status_unorder)
}
}, UiThreadHandler.MODE.QUEUE)
}
interface IVisualCallback {
fun setImageViewResource(@DrawableRes name: Int)
}
}

View File

@@ -0,0 +1,46 @@
package com.mogo.och.common.module.wigets.map.reportworkorder
import android.content.Context
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatImageView
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.och.common.module.R
/**
*
*/
class ReportWorkOrderView : AppCompatImageView{
private val TAG = "VisualView"
constructor(context: Context) : super(context)
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(
context,
attributeSet,
defStyleAttr
)
private fun initView() {
setImageResource(R.drawable.common_reportwork)
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerDevaToolsManager.reportWorkOrder(this)
}
init {
try {
initView()
} catch (e: Exception) {
e.printStackTrace()
}
}
}

View File

@@ -0,0 +1,72 @@
package com.mogo.och.common.module.wigets.map.switchvisual
import android.content.Context
import android.util.AttributeSet
import android.view.View
import androidx.appcompat.widget.AppCompatImageView
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.findViewTreeViewModelStoreOwner
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.common.module.R
/**
*
*/
class VisualView : AppCompatImageView, VisualViewModel.IVisualCallback {
private val TAG = "VisualView"
constructor(context: Context) : super(context)
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(
context,
attributeSet,
defStyleAttr
)
private fun initView() {
setImageResource(R.drawable.common_visual_medium)
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
val viewModel = findViewTreeViewModelStoreOwner()?.let {
ViewModelProvider(it).get(VisualViewModel::class.java)
}
viewModel?.setDistanceCallback(this)
onClick {
viewModel?.changeVisualView()
}
}
init {
try {
initView()
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun setViewShow(boolean: Boolean) {
UiThreadHandler.post({
if (boolean) {
visibility = View.VISIBLE
} else {
visibility = View.GONE
}
}, UiThreadHandler.MODE.QUEUE)
}
override fun setViewResource(resource: Int) {
UiThreadHandler.post({
setImageResource(resource)
}, UiThreadHandler.MODE.QUEUE)
}
}

View File

@@ -0,0 +1,91 @@
package com.mogo.och.common.module.wigets.map.switchvisual
import androidx.lifecycle.ViewModel
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.map.listener.IMogoMapListener
import com.mogo.map.listener.MogoMapListenerHandler
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.och.common.module.R
class VisualViewModel : ViewModel(), IMogoMapListener {
private val TAG = VisualViewModel::class.java.simpleName
private var viewCallback: IVisualCallback? = null
init {
}
override fun onCleared() {
super.onCleared()
MogoMapListenerHandler.mogoMapListenerHandler.unregisterHostMapListener(TAG)
this.viewCallback = null
}
fun setDistanceCallback(viewCallback: IVisualCallback) {
MogoMapListenerHandler.mogoMapListenerHandler.registerHostMapListener(TAG, this)
this.viewCallback = viewCallback
}
override fun onMapVisualAngleChanged(visualAngleMode: VisualAngleMode?) {
CallerLogger.d(TAG,"视角切换成功${visualAngleMode}")
visualAngleMode?.let {
if (visualAngleMode.isMediumSight) {
this.viewCallback?.setViewShow(true)
this.viewCallback?.setViewResource(R.drawable.common_visual_medium)
} else if (visualAngleMode.isLongSight) {
this.viewCallback?.setViewShow(true)
this.viewCallback?.setViewResource(R.drawable.common_visual_long)
} else if (visualAngleMode.isCloseSight) {
this.viewCallback?.setViewShow(false)
} else{
this.viewCallback?.setViewShow(false)
}
}
}
override fun onMapLoaded() {
super.onMapLoaded()
CallerLogger.d(TAG,"地图加载成功 onMapLoaded")
val mapUIController = CallerMapUIServiceManager.getMapUIController()
mapUIController?.let {
val visualAngleMode = mapUIController.currentMapVisualAngle
if (visualAngleMode.isMediumSight) {
this.viewCallback?.setViewShow(true)
this.viewCallback?.setViewResource(R.drawable.common_visual_medium)
} else if (visualAngleMode.isLongSight) {
this.viewCallback?.setViewShow(true)
this.viewCallback?.setViewResource(R.drawable.common_visual_long)
} else if (visualAngleMode.isCloseSight) {
this.viewCallback?.setViewShow(false)
} else{
this.viewCallback?.setViewShow(false)
}
}
}
fun changeVisualView() {
val mapUIController = CallerMapUIServiceManager.getMapUIController()
mapUIController?.currentMapVisualAngle?.let {
CallerLogger.d(TAG,"切换视角:${it}")
if (it.isLongSight) {
mapUIController.setLockMode(true);
mapUIController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
} else if (it.isMediumSight) {
mapUIController.setLockMode(false);
mapUIController.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
} else {
mapUIController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
}
}
}
interface IVisualCallback {
fun setViewShow(boolean: Boolean)
fun setViewResource(resource: Int)
}
}

View File

@@ -0,0 +1,48 @@
package com.mogo.och.common.module.wigets.map.toolsview
import android.content.Context
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatImageView
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.och.common.module.R
/**
*
*/
class ToolsView : AppCompatImageView{
private val TAG = "VisualView"
constructor(context: Context) : super(context)
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(
context,
attributeSet,
defStyleAttr
)
private fun initView() {
setImageResource(R.drawable.common_tools_view)
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
onClick {
CallerHmiManager.showToolsView();
}
}
init {
try {
initView()
} catch (e: Exception) {
e.printStackTrace()
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/common_arrive_station_press" android:state_focused="true" android:state_pressed="true" />
<item android:drawable="@drawable/common_arrive_station_press" android:state_focused="false" android:state_pressed="true" />
<item android:drawable="@drawable/common_arrive_station_press" android:state_selected="true" />
<item android:drawable="@drawable/common_arrive_station_press" android:state_focused="true" />
<item android:drawable="@drawable/common_arrive_station_normal" />
</selector>

View File

@@ -0,0 +1,9 @@
<?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/common_reportwork_press">
</item>
<item android:drawable="@drawable/common_reportwork_normal">
</item>
</selector>

View File

@@ -0,0 +1,9 @@
<?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/common_tools_view_press">
</item>
<item android:drawable="@drawable/common_tools_view_normal">
</item>
</selector>

View File

@@ -1,8 +1,9 @@
<?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_map_long_press">
</item>
<item android:drawable="@drawable/start_success">
<item android:drawable="@drawable/common_map_long">
</item>
</selector>

View File

@@ -0,0 +1,9 @@
<?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/common_map_medium_press">
</item>
<item android:drawable="@drawable/common_map_medium">
</item>
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.amap.api.navi.AMapNaviView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/amapNaviView"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View File

@@ -10,7 +10,6 @@ import android.view.ViewGroup;
import android.view.animation.LinearInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -30,7 +29,6 @@ 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;
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.msgbox.DriverMsgBoxBubbleView;
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
@@ -40,10 +38,7 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.MogoMap;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.listener.MogoMapListenerHandler;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.och.common.module.utils.ResourcesUtils;
import com.mogo.och.shuttle.R;
import com.mogo.och.shuttle.view.BizMapView;
@@ -60,7 +55,7 @@ import org.greenrobot.eventbus.EventBus;
*
* @author tongchenfei
*/
public abstract class BaseShuttleTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener {
public abstract class BaseShuttleTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> {
private static final String TAG = "BaseBusTabFragment";
@@ -69,18 +64,9 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
private ImageView ctvAutopilotStatusIv;
private TextView ctvAutopilotStatusTv;
protected TextView tvArrived;
protected RelativeLayout mSettingBtn;
protected RelativeLayout mBadcaseBtn;
protected RelativeLayout mAICollectBtn;
private FrameLayout flStationPanelContainer;
private BizMapView mapBizView;
private Group groupTestPanel;
// private ShuttleTrafficDataView mTrafficDataView;
// private BusTrafficLightView mTrafficLightView;
//远景和中景的切换
private ImageView mSwitchMapModeImage;
private LinearLayout mSwitchMapModeLayout;
protected SmallMapView smallMapView;
@@ -118,13 +104,8 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
ctvAutopilotStatusTv = findViewById(R.id.bus_autopolot_btn_tv);
flStationPanelContainer = findViewById(R.id.module_mogo_och_station_panel_container);
// mTrafficLightView = findViewById(R.id.bus_traffic_light_view);
// CallerHmiManager.INSTANCE.setProxyTrafficLightView(mTrafficLightView);
// tvOperationStatus = findViewById(R.id.module_mogo_och_operation_status);
tvArrived = findViewById(R.id.module_mogo_och_arrived_tv);
// mTrafficDataView = (ShuttleTrafficDataView) findViewById(R.id.bus_arc);
FrameLayout flSpeed = findViewById(R.id.fl_speed);
if (flSpeed != null) {
CallerDevaToolsManager.INSTANCE.attachAutopilotBeforeLaunchView(flSpeed.getContext(), flSpeed);
@@ -133,33 +114,8 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer);
slidePanelView.setOnSlidePanelMoveToEndListener(onSlideToEndListener);
mSwitchMapModeLayout = findViewById(R.id.bus_switch_model_layout);
mSwitchMapModeImage = findViewById(R.id.bus_switch_model_icon);
updateSwitchMapIcon();
mSwitchMapModeLayout.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl(View v) {
if(mapBizView != null){
IMogoMapUIController uiController = mapBizView.getUI();
if(uiController != null){
if (uiController.getCurrentMapVisualAngle().isLongSight()) {
uiController.setLockMode(true);
uiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else if (uiController.getCurrentMapVisualAngle().isMediumSight()) {
uiController.setLockMode(false);
uiController.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else {
uiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
}
}
}
}
});
initListener();
setAutopilotBtnStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState(),
CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(false, 0));
@@ -199,23 +155,6 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
onArriveStation();
});
mSettingBtn = findViewById(R.id.module_mogo_och_setting_layout);
mSettingBtn.setOnClickListener(v -> {
// TODO: 2021/12/9
CallerHmiManager.INSTANCE.showToolsView();
});
// mBadcaseBtn的visible显示逻辑在showBadcaseEntrance内处理
mBadcaseBtn = findViewById(R.id.module_mogo_och_badcase_rl);
if (mBadcaseBtn != null) {
CallerDevaToolsManager.INSTANCE.reportWorkOrder(mBadcaseBtn);
}
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl);
if (mAICollectBtn != null) {
CallerDevaToolsManager.INSTANCE.initAiCollect(mAICollectBtn);
}
//消息盒子
viewDriverMsgBoxButton = findViewById(R.id.viewDriverMsgBoxButton);
viewDriverMsgBoxList = findViewById(R.id.viewDriverMsgBoxList);
@@ -272,18 +211,6 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
HdMapBuildConfig.currentCarVrIconRes = R.raw.xiaoba;
}
}
if(mapBizView != null){
IMogoMapUIController uiController = mapBizView.getUI();
if(uiController != null){
if (uiController.getCurrentMapVisualAngle().isLongSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else if (uiController.getCurrentMapVisualAngle().isMediumSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
}
}
}
}
@Override
@@ -322,7 +249,7 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
protected abstract void debugArrivedStation();
private void initListener() {
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, this);
}
/**
@@ -508,7 +435,6 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
isAnimateRunning = true;
ctvAutopilotStatusTv.setText(ResourcesUtils.getString(R.string.bus_loading_autopilot_tv));
ctvAutopilotStatusTv.setTextColor(ResourcesUtils.getColor(R.color.bus_autopilot_text_color_normal));
// ctvAutopilotStatus.setSelected(false);
ctvAutopilotStatus.setClickable(true);
ctvAutopilotStatusIv.setImageResource(R.drawable.bus_loading_autopilot_icon);
if (autopilotLoadingAnimator == null) {
@@ -564,18 +490,6 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
@Override
public void onDestroy() {
super.onDestroy();
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().unregisterHostMapListener(TAG);
}
@Override
public void onMapVisualAngleChanged(VisualAngleMode visualAngleMode) {
if (visualAngleMode.isMediumSight()) {
mSwitchMapModeLayout.setVisibility(View.VISIBLE);
} else if (visualAngleMode.isLongSight()) {
mSwitchMapModeLayout.setVisibility(View.VISIBLE);
} else if (visualAngleMode.isCloseSight()) {
mSwitchMapModeLayout.setVisibility(View.GONE);
}
}
/**

View File

@@ -1,169 +0,0 @@
package com.mogo.och.shuttle.ui;
import static com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisBrakeStateListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisThrottleStateListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisBrakeStateListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisThrottleStateListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.och.shuttle.R;
import org.jetbrains.annotations.NotNull;
import chassis.Chassis;
import mogo.telematics.pad.MessagePad;
/**
* @author Jing
* @description 速度 加速度 档位 刹车 油门状态值
* @since: 6/24/22
*/
public class ShuttleTrafficDataView extends ConstraintLayout implements
IMoGoChassisGearStateListener ,
IMoGoChassisBrakeStateListener,
IMoGoChassisThrottleStateListener,
IMoGoAutopilotPlanningActionsListener {
private static final String TAG = "TrafficDataView";
private ShuttleTapPositionView tapPositionView;
private TextView speedTextView;
private TextView accTextView;
private ImageView speedImage;
private ImageView brakeStatus;
private static final int MSG_SEND_UPDATE = 1;
private volatile double acceleration;
private volatile float mBrake;
private volatile float mThrottle;
@SuppressLint("HandlerLeak")
private final Handler handler = new Handler() {
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
if (msg.what == MSG_SEND_UPDATE) {
java.text.DecimalFormat mFormat = new java.text.DecimalFormat("0.0");
String accStr = mFormat.format(Math.abs(acceleration));
if (acceleration > 0f) {
accTextView.setText(accStr);
} else {
accTextView.setText("- " + accStr);
}
int state = CallerAutoPilotStatusListenerManager.INSTANCE.getState();
if (state < STATUS_AUTOPILOT_RUNNING) {
if (mBrake > 0) {
brakeStatus.setImageResource(R.drawable.traffic_data_brake);
} else if (mThrottle >= 0 && mBrake == 0) {
brakeStatus.setImageResource(R.drawable.traffic_data_accelerator);
} else {
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
}
}
if (state == 2) {
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
}
}
handler.sendEmptyMessageDelayed(MSG_SEND_UPDATE, 1000L);
}
};
public ShuttleTrafficDataView(@NonNull Context context) {
super(context);
}
public ShuttleTrafficDataView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
initView(context);
}
public ShuttleTrafficDataView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public ShuttleTrafficDataView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
handler.sendEmptyMessageDelayed(MSG_SEND_UPDATE, 1000L);
CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisBrakeStateListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisThrottleStateListenerManager.INSTANCE.addListener(TAG, this);
CallerPlanningActionsListenerManager.INSTANCE.addListener(TAG, this);
}
private void initView(@NonNull Context context) {
LayoutInflater.from(context).inflate(R.layout.shuttle_traffic_data, this);
tapPositionView = findViewById(R.id.traffic_position);
speedImage = findViewById(R.id.speedImage);
speedTextView = findViewById(R.id.speedTextView);
accTextView = findViewById(R.id.speedAccTextView);
brakeStatus = findViewById(R.id.brakeStatus);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
CallerChassisGearStateListenerManager.INSTANCE.removeListener(TAG);
CallerChassisBrakeStateListenerManager.INSTANCE.removeListener(TAG);
CallerChassisThrottleStateListenerManager.INSTANCE.removeListener(TAG);
CallerPlanningActionsListenerManager.INSTANCE.removeListener(TAG);
}
@Override
public void pncActions(@NonNull MessagePad.PlanningActionMsg planningActionMsg) {
acceleration = planningActionMsg.getDestinationAcc();
}
/**
* 档位
*/
@Override
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
ThreadUtils.runOnUiThread(() -> {
if (tapPositionView != null) {
tapPositionView.updateWithGear(gear);
}
});
}
@Override
public void onAutopilotBrake(float brake) {
mBrake = brake;
}
@Override
public void onAutopilotThrottle(float throttle) {
mThrottle = throttle;
}
/**
* value呈现
*/
public void updateSpeedWithValue(int newSpeed) {
if (speedTextView != null) {
speedTextView.setText(String.valueOf(newSpeed));
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

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