[M2] M2 UI

This commit is contained in:
wangmingjun
2023-02-15 15:13:58 +08:00
parent f82879268b
commit 3e2866f508
15 changed files with 89 additions and 13 deletions

View File

@@ -79,6 +79,9 @@ class PM2DrivingModel private constructor() {
fun init(context : Context){
mContext = context
initListener()
// TODO: 2022/3/31
queryDriverOperationStatus()
startOrStopOrderLoop(true)
}
private fun initListener() {
@@ -417,4 +420,13 @@ class PM2DrivingModel private constructor() {
PM2ModelLoopManager.stopOrStopRouteAndWipe()
}
}
private fun startOrStopOrderLoop(start: Boolean) {
d(SceneConstant.M_BUS_P + TAG, "startOrStopOrderLoop() $start")
if (start) {
PM2ModelLoopManager.startQueryDriverLineLoop()
} else {
PM2ModelLoopManager.stopQueryDriverLineLoop()
}
}
}

View File

@@ -26,7 +26,8 @@ object PM2ServiceManager {
* @return
*/
private val driverAppSn: String
get() = getServerToken()
// get() = getServerToken()
get() = "X2020220425Q466X1F"
/**
* 查询绑定行驶的小巴车路线

View File

@@ -74,7 +74,7 @@ class PM2DrivingInfoFragment :
DateTimeUtils.getCurrentDateTime(),HH_mm)
val date = formatCalendarToString(
DateTimeUtils.getCurrentDateTime(), yyyy_MM_dd)
DateTimeUtils.getCurrentDateTime(), yy_MM_dd)
val weekDay = DateTimeUtils.getWeekDayFromCalendar1(DateTimeUtils.getCurrentDateTime())
current_weekday_tv.text = "$date $weekDay"

View File

@@ -35,7 +35,7 @@ class M2StatusBarView @JvmOverloads constructor(
init {
LayoutInflater.from(context).inflate(R.layout.p_m2_view_status_bar, this, true)
setBackgroundColor(Color.TRANSPARENT)
setBackgroundColor(Color.parseColor("#80FFFFFF"))
}
override fun onAttachedToWindow() {

View File

@@ -2,7 +2,6 @@ package com.mogo.och.bus.passenger.ui.widget
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
/**
@@ -11,5 +10,7 @@ import com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
*/
class M2TurnLightView @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null
) {
) : TurnLightViewStatus(context, attrs) {
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#b2afc9e7" />
<corners android:radius="@dimen/dp_18" />
</shape>

View File

@@ -34,7 +34,6 @@
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="@+id/img_drive_bg"
android:layout_marginLeft="@dimen/dp_24"
android:layout_marginTop="@dimen/dp_8"
app:layout_constraintTop_toTopOf="@+id/img_drive_bg"
tools:ignore="SpUsage" />
@@ -62,13 +61,15 @@
app:layout_constraintTop_toBottomOf="@+id/speed_tv" />
<!-- 转向灯 IMoGoChassisLamplightListener-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
<com.mogo.och.bus.passenger.ui.widget.M2TurnLightView
android:id="@+id/turn_light_view"
android:layout_width="@dimen/dp_68"
android:layout_height="@dimen/dp_38"
android:layout_marginLeft="@dimen/dp_12"
app:layout_constraintLeft_toRightOf="@+id/auto_tv"
app:layout_constraintTop_toTopOf="@+id/auto_tv" />
app:layout_constraintTop_toTopOf="@+id/auto_tv"
app:visible="true"
app:day_light_mode="true"/>
<!-- 红绿灯-->
<com.mogo.och.bus.passenger.ui.widget.M2PTrafficLightView android:id="@+id/traffic_light_view"

View File

@@ -13,11 +13,11 @@
<!-- 消息盒子气泡-->
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView
<com.mogo.eagle.core.function.hmi.ui.msgbox.MBoxBubbleView
android:id="@+id/box_bubble_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<!--pnc行为决策-->

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_66"
android:layout_height="@dimen/dp_38"
android:visibility="visible">
<FrameLayout
android:id="@+id/turn_light_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:background="@drawable/brakelight_background_daytime"
android:layout_gravity="top|center_horizontal"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<ImageView
android:id="@+id/left_nor_image"
android:layout_width="@dimen/dp_19"
android:layout_height="@dimen/dp_21"
android:layout_gravity="left|center_vertical"
android:layout_marginLeft="@dimen/dp_10"
android:src="@drawable/m2_zuozhuan_un_open" />
<ImageView
android:id="@+id/right_nor_image"
android:layout_width="@dimen/dp_19"
android:layout_height="@dimen/dp_21"
android:layout_gravity="right|center_vertical"
android:layout_marginRight="@dimen/dp_10"
android:src="@drawable/m2_youzhuan_un_open" />
<ImageView
android:id="@+id/left_select_image"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_22"
android:layout_gravity="left|center_vertical"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="2dp"
android:src="@drawable/m2_zuozhuan_open"
android:visibility="gone" />
<ImageView
android:id="@+id/right_select_image"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_22"
android:layout_gravity="right|center_vertical"
android:layout_marginTop="2dp"
android:layout_marginRight="10dp"
android:src="@drawable/m2_youzhuan_open"
android:visibility="gone" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -11,8 +11,8 @@
<string name="bus_p_cur_station_arrived_tip">请携带好随身物品下车。</string>
<string name="bus_p_cur_station_arrived_tip_init">欢迎乘坐蘑菇车联自动驾驶车。</string>
<string name="m2_over_map_style_path">src/m2/assets/m2_map_style.data</string>
<string name="m2_over_map_style_extra_path">src/m2/assets/m2_map_style_extra.data</string>
<string name="m2_over_map_style_path">m2_map_style.data</string>
<string name="m2_over_map_style_extra_path">m2_map_style_extra.data</string>
<string name="m2_p_auto_tv">Auto</string>
</resources>

View File

@@ -15,7 +15,8 @@ public class DateTimeUtil {
public static final String MM_dd = "MM-dd";
public static final String MM_dd_HH_mm = "MM-dd HH:mm";
public static final String yyyy_MM_dd = "yyyy-MM-dd";
public static final String yy_MM_dd = "yy-MM-dd";
public static final String yyyyMMdd = "yyyy-MM-dd";
public static final String yy_MM_dd = "yy.MM.dd";
public static final String yyyy_MM_dd_HH_mm = "yyyy-MM-dd HH:mm";
public static String formatCalendarToString(Calendar calendar, String format){