[6.5.0]行程总结数据管理

This commit is contained in:
xuxinchao
2024-07-02 15:57:52 +08:00
parent a9ae61f310
commit 02099335af
4 changed files with 91 additions and 19 deletions

View File

@@ -4,8 +4,11 @@ import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.widget.ImageView
import android.widget.TextView
import com.mogo.eagle.core.data.autopilot.AutopilotSummaryInfo
import com.mogo.eagle.core.function.hmi.R
import me.jessyan.autosize.utils.AutoSizeUtils
import java.util.Random
/**
* 行程总结View
@@ -17,7 +20,15 @@ class ItinerarySummaryDialog(context: Context, isDriver: Boolean, theme: Int) :
private val mContext: Context
private val isDriver: Boolean
private var ivSummaryClose: ImageView ?= null
private var ivSummaryClose: ImageView ?= null //关闭弹窗按钮
private var tvSummaryZhiContent: TextView ?= null //小智总结
private var tvIntersectionServicesNum: TextView ?= null //全息路口服务次数
private var tvLightServicesNum: TextView ?= null //路口灯态服务次数
private var tvInfoTipNum: TextView ?= null //道路信息提醒次数
private var tvVehicleTipNum: TextView ?= null //车辆行为提醒次数
private var tvVulnerableTipNum: TextView ?= null //弱势参与者提醒次数
private var tvDangerNum: TextView ?= null //消除安全风险隐患次数
private var tvEfficiencyNum: TextView ?= null //通行效率提升
init {
this.mContext = context
@@ -47,8 +58,33 @@ class ItinerarySummaryDialog(context: Context, isDriver: Boolean, theme: Int) :
ivSummaryClose?.setOnClickListener {
dismiss()
}
//小智总结
tvSummaryZhiContent = findViewById(R.id.tvSummaryZhiContent)
//TODO 小智总结文案
//全息路口服务次数
tvIntersectionServicesNum = findViewById(R.id.tvIntersectionServicesNum)
tvIntersectionServicesNum?.text = AutopilotSummaryInfo.intersectionServicesNum.toString()
//路口灯态服务次数
tvLightServicesNum = findViewById(R.id.tvLightServicesNum)
tvLightServicesNum?.text = AutopilotSummaryInfo.lightServicesNum.toString()
//道路信息提醒次数
tvInfoTipNum = findViewById(R.id.tvInfoTipNum)
tvInfoTipNum?.text = AutopilotSummaryInfo.infoTipNum.toString()
//车辆行为提醒次数
tvVehicleTipNum = findViewById(R.id.tvVehicleTipNum)
tvVehicleTipNum?.text = AutopilotSummaryInfo.vehicleTipNum.toString()
//弱势参与者提醒次数
tvVulnerableTipNum = findViewById(R.id.tvVulnerableTipNum)
tvVulnerableTipNum?.text = AutopilotSummaryInfo.vulnerableTipNum.toString()
//消除安全风险隐患次数
tvDangerNum = findViewById(R.id.tvDangerNum)
tvDangerNum?.text = AutopilotSummaryInfo.dangerNum.toString()
//通行效率提升:本期为假数据数据为百分数值为7-14%之间的随机数保留小数点后1位
tvEfficiencyNum = findViewById(R.id.tvEfficiencyNum)
val random = Random()
val next: Float= random.nextInt(70).toFloat()/10
val num = next + 7
tvEfficiencyNum?.text = num.toString()
}

View File

@@ -30,6 +30,7 @@
/>
<TextView
android:id="@+id/tvSummaryZhiContent"
android:layout_width="@dimen/dp_738"
android:layout_height="@dimen/dp_60"
app:layout_constraintTop_toTopOf="@id/ivSummaryZhi"
@@ -128,7 +129,6 @@
android:textSize="@dimen/sp_72"
android:textColor="@color/summary_service_num"
app:layout_constraintHorizontal_chainStyle="packed"
android:text="1"
/>
<TextView
@@ -155,7 +155,6 @@
android:textSize="@dimen/sp_72"
android:textColor="@color/summary_service_num"
app:layout_constraintHorizontal_chainStyle="packed"
android:text="4"
/>
<TextView
@@ -182,7 +181,6 @@
android:textSize="@dimen/sp_72"
android:textColor="@color/summary_service_num"
app:layout_constraintHorizontal_chainStyle="packed"
android:text="3"
/>
<TextView
@@ -209,7 +207,6 @@
android:textSize="@dimen/sp_72"
android:textColor="@color/summary_service_num"
app:layout_constraintHorizontal_chainStyle="packed"
android:text="2"
/>
<TextView
@@ -236,8 +233,6 @@
android:textSize="@dimen/sp_72"
android:textColor="@color/summary_service_num"
app:layout_constraintHorizontal_chainStyle="packed"
android:text="5"
/>
<TextView
@@ -288,7 +283,6 @@
app:layout_constraintHorizontal_chainStyle="packed"
android:textColor="@color/summary_danger_num"
android:textSize="@dimen/sp_150"
android:text="5"
android:layout_marginTop="@dimen/dp_80"
/>
@@ -338,7 +332,6 @@
app:layout_constraintHorizontal_chainStyle="packed"
android:textColor="@color/summary_danger_num"
android:textSize="@dimen/sp_150"
android:text="13"
android:layout_marginTop="@dimen/dp_80"
/>

View File

@@ -30,6 +30,7 @@
/>
<TextView
android:id="@+id/tvSummaryZhiContent"
android:layout_width="@dimen/dp_927"
android:layout_height="@dimen/dp_84"
app:layout_constraintTop_toTopOf="@id/ivSummaryZhi"
@@ -128,7 +129,6 @@
android:textSize="@dimen/sp_94"
android:textColor="@color/summary_service_num_p"
app:layout_constraintHorizontal_chainStyle="packed"
android:text="1"
/>
<TextView
@@ -155,7 +155,6 @@
android:textSize="@dimen/sp_94"
android:textColor="@color/summary_service_num_p"
app:layout_constraintHorizontal_chainStyle="packed"
android:text="4"
/>
<TextView
@@ -182,7 +181,6 @@
android:textSize="@dimen/sp_94"
android:textColor="@color/summary_service_num_p"
app:layout_constraintHorizontal_chainStyle="packed"
android:text="3"
/>
<TextView
@@ -209,7 +207,6 @@
android:textSize="@dimen/sp_94"
android:textColor="@color/summary_service_num_p"
app:layout_constraintHorizontal_chainStyle="packed"
android:text="2"
/>
<TextView
@@ -236,8 +233,6 @@
android:textSize="@dimen/sp_94"
android:textColor="@color/summary_service_num_p"
app:layout_constraintHorizontal_chainStyle="packed"
android:text="5"
/>
<TextView
@@ -288,7 +283,6 @@
app:layout_constraintHorizontal_chainStyle="packed"
android:textColor="@color/summary_danger_num_p"
android:textSize="@dimen/sp_195"
android:text="5"
android:layout_marginTop="@dimen/dp_120"
/>
@@ -338,7 +332,6 @@
app:layout_constraintHorizontal_chainStyle="packed"
android:textColor="@color/summary_danger_num_p"
android:textSize="@dimen/sp_195"
android:text="13"
android:layout_marginTop="@dimen/dp_120"
/>