Merge branch 'dev_robo_240612_6.5.0_tmp' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robo_240612_6.5.0_tmp
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.hmi.ui.notice.traffic
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
@@ -80,8 +79,6 @@ class TrafficLightPromptView @JvmOverloads constructor(
|
||||
*/
|
||||
override fun onShowTrafficLightPrompt(currentState: TrafficLightEnum, currentDuration: Int) {
|
||||
super.onShowTrafficLightPrompt(currentState, currentDuration)
|
||||
Log.i("xuxinchao","TrafficLightPromptView onTrafficLightPrompt")
|
||||
Log.i("xuxinchao","onShowTrafficLightPrompt user="+user)
|
||||
ThreadUtils.runOnUiThread {
|
||||
when(currentState){
|
||||
TrafficLightEnum.GREEN->{
|
||||
@@ -90,7 +87,6 @@ class TrafficLightPromptView @JvmOverloads constructor(
|
||||
tvTrafficNum?.setTextColor(ContextCompat.getColor(context,R.color.light_prompt_green))
|
||||
tvTrafficNumDecimal?.setTextColor(ContextCompat.getColor(context,R.color.light_prompt_green))
|
||||
}else{
|
||||
Log.i("xuxinchao","user="+user)
|
||||
tvTrafficNum?.setTextColor(ContextCompat.getColor(context,R.color.light_prompt_green_p))
|
||||
tvTrafficNumDecimal?.setTextColor(ContextCompat.getColor(context,R.color.light_prompt_green_p))
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import android.graphics.Typeface
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
|
||||
/**
|
||||
* 融合红绿灯倒计时特定字体TextView
|
||||
@@ -19,8 +20,20 @@ class TypefaceTextView constructor(
|
||||
}
|
||||
|
||||
private fun initTypefaceTextView(context: Context, attrs: AttributeSet) {
|
||||
val typeface = Typeface.createFromAsset(context.assets, "digital-7.ttf")
|
||||
setTypeface(typeface)
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.TypefaceTextView)
|
||||
val type = typedArray.getInt(R.styleable.TypefaceTextView_textType, 0)
|
||||
if (type == 0) {
|
||||
return
|
||||
}
|
||||
var typeface: Typeface? = null
|
||||
when (type) {
|
||||
1 -> typeface = Typeface.createFromAsset(context.assets, "DS-DIGI-1.ttf")
|
||||
2 -> typeface = Typeface.createFromAsset(context.assets, "DS-DIGIB-2.ttf")
|
||||
3 -> typeface = Typeface.createFromAsset(context.assets, "DS-DIGII-3.ttf")
|
||||
4 -> typeface = Typeface.createFromAsset(context.assets, "DS-DIGIT-4.ttf")
|
||||
}
|
||||
typeface?.let { setTypeface(it) }
|
||||
typedArray.recycle()
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 14 KiB |
@@ -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"
|
||||
/>
|
||||
|
||||
|
||||
@@ -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"
|
||||
/>
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_55"
|
||||
android:textStyle="bold"
|
||||
app:textType="DS_DIGIB_2"
|
||||
/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.ProportionChartView
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
android:layout_marginLeft="@dimen/dp_150"
|
||||
android:textSize="@dimen/sp_30"
|
||||
android:textColor="@color/white"
|
||||
android:text="即将绿灯"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -23,8 +24,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvPromptTitle"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvPromptTitle"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:textSize="@dimen/sp_21"
|
||||
android:textColor="@color/white"
|
||||
android:text="请准备出发"
|
||||
/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TypefaceTextView
|
||||
@@ -33,7 +36,11 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvPromptContent"
|
||||
android:textSize="@dimen/sp_30"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:textSize="@dimen/sp_40"
|
||||
android:text=".99"
|
||||
android:textColor="@color/light_prompt_red"
|
||||
app:textType="DS_DIGIB_2"
|
||||
/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TypefaceTextView
|
||||
@@ -42,7 +49,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvTrafficNumDecimal"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvTrafficNumDecimal"
|
||||
android:textSize="@dimen/sp_76"
|
||||
android:textSize="@dimen/sp_90"
|
||||
android:text="3"
|
||||
android:textColor="@color/light_prompt_red"
|
||||
app:textType="DS_DIGIB_2"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -15,6 +15,7 @@
|
||||
android:textColor="@color/light_prompt_content"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
android:text="即将红灯,请减速慢行"
|
||||
/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TypefaceTextView
|
||||
@@ -24,6 +25,9 @@
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvPromptContent"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvPromptContent"
|
||||
android:textSize="@dimen/sp_76"
|
||||
android:text="2"
|
||||
android:layout_marginLeft="@dimen/dp_25"
|
||||
app:textType="DS_DIGIB_2"
|
||||
/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TypefaceTextView
|
||||
@@ -33,6 +37,9 @@
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvTrafficNum"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvTrafficNum"
|
||||
android:textSize="@dimen/sp_30"
|
||||
android:text=".99"
|
||||
app:textType="DS_DIGIB_2"
|
||||
android:gravity="bottom"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -143,4 +143,13 @@
|
||||
</attr>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TypefaceTextView">
|
||||
<attr name="textType">
|
||||
<enum name="DS_DIGI_1" value="1"/>
|
||||
<enum name="DS_DIGIB_2" value="2"/>
|
||||
<enum name="DS_DIGII_3" value="3"/>
|
||||
<enum name="DS_DIGIT_4" value="4"/>
|
||||
</attr>
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.mogo.eagle.core.data.autopilot
|
||||
|
||||
/**
|
||||
* 行程总结报告数据
|
||||
*/
|
||||
object AutopilotSummaryInfo {
|
||||
|
||||
/**
|
||||
* 全息路口服务次数
|
||||
*/
|
||||
@JvmField
|
||||
@Volatile
|
||||
var intersectionServicesNum = 0
|
||||
|
||||
/**
|
||||
* 路口灯态服务次数
|
||||
*/
|
||||
@JvmField
|
||||
@Volatile
|
||||
var lightServicesNum = 0
|
||||
|
||||
/**
|
||||
* 道路信息提醒次数
|
||||
*/
|
||||
@JvmField
|
||||
@Volatile
|
||||
var infoTipNum = 0
|
||||
|
||||
/**
|
||||
* 车辆行为提醒次数
|
||||
*/
|
||||
@JvmField
|
||||
@Volatile
|
||||
var vehicleTipNum = 0
|
||||
|
||||
/**
|
||||
* 弱势参与者提醒次数
|
||||
*/
|
||||
@JvmField
|
||||
@Volatile
|
||||
var vulnerableTipNum = 0
|
||||
|
||||
/**
|
||||
* 消除安全风险隐患次数
|
||||
*/
|
||||
@JvmField
|
||||
@Volatile
|
||||
var dangerNum = 0
|
||||
|
||||
}
|
||||
@@ -1081,6 +1081,7 @@
|
||||
<dimen name="sp_55">55dp</dimen>
|
||||
<dimen name="sp_72">72dp</dimen>
|
||||
<dimen name="sp_76">76dp</dimen>
|
||||
<dimen name="sp_90">90dp</dimen>
|
||||
<dimen name="sp_94">94dp</dimen>
|
||||
<dimen name="sp_120">120dp</dimen>
|
||||
<dimen name="sp_150">150dp</dimen>
|
||||
|
||||
Reference in New Issue
Block a user