Merge branch 'dev_robotaxi-d-app-module_2132_221223_2.13.2' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_2132_221223_2.13.2
This commit is contained in:
@@ -942,58 +942,60 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
playTts: Boolean,
|
||||
expireTime: Long
|
||||
) {
|
||||
val playTTS =
|
||||
playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
activity?.let {
|
||||
val warningContent = alertContent
|
||||
?: EventTypeEnumNew.getWarningContent(v2xType)
|
||||
ThreadUtils.runOnUiThread {
|
||||
val playTTS =
|
||||
playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
activity?.let {
|
||||
val warningContent = alertContent
|
||||
?: EventTypeEnumNew.getWarningContent(v2xType)
|
||||
|
||||
// Log.d("liyz", "warningV2X v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent")
|
||||
//占道施工预警
|
||||
if (v2xType.equals("10006") || v2xType.equals("100061")) {
|
||||
val currentTime = System.currentTimeMillis() / 1000
|
||||
val oldTime =
|
||||
context?.let { it -> SharedPrefsMgr.getInstance(it).getLong("roadwork", 0) }
|
||||
if (currentTime - oldTime!! > 60) { //超过一分钟,才会继续播报重复提醒
|
||||
context?.let { it ->
|
||||
SharedPrefsMgr.getInstance(it)
|
||||
.putLong("roadwork", System.currentTimeMillis() / 1000)
|
||||
//占道施工预警
|
||||
if (v2xType == "10006" || v2xType == "100061") {
|
||||
val currentTime = System.currentTimeMillis() / 1000
|
||||
val oldTime =
|
||||
context?.let { it -> SharedPrefsMgr.getInstance(it).getLong("roadwork", 0) }
|
||||
if (currentTime - oldTime!! > 60) { //超过一分钟,才会继续播报重复提醒
|
||||
context?.let { it ->
|
||||
SharedPrefsMgr.getInstance(it)
|
||||
.putLong("roadwork", System.currentTimeMillis() / 1000)
|
||||
}
|
||||
CallerAutoPilotManager.sendTripInfo(5, "", "", "", false)
|
||||
}
|
||||
CallerAutoPilotManager.sendTripInfo(5, "", "", "", false)
|
||||
}
|
||||
}
|
||||
if (warningContent.isEmpty()) {
|
||||
CallerLogger.e("$M_HMI$TAG", "Show warningContent is null or empty!")
|
||||
return
|
||||
}
|
||||
listener?.onShow()
|
||||
CallerLogger.d(
|
||||
"$M_HMI$TAG",
|
||||
"--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime"
|
||||
)
|
||||
lastShowV2XJob?.safeCancel()
|
||||
lifecycleScope.launch {
|
||||
delay(expireTime)
|
||||
}.also { itx ->
|
||||
lastShowV2XJob = itx
|
||||
}.invokeOnCompletion { _ ->
|
||||
listener?.onDismiss()
|
||||
showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
}
|
||||
|
||||
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
|
||||
val last = lastSpeakJob.get()
|
||||
Log.d("CODE", "---- 0 ------: last: $last")
|
||||
if (last != null && !last.isCompleted) {
|
||||
Log.d("CODE", "---- 1 ------")
|
||||
return
|
||||
if (warningContent.isEmpty()) {
|
||||
CallerLogger.e("$M_HMI$TAG", "Show warningContent is null or empty!")
|
||||
return@runOnUiThread
|
||||
}
|
||||
lifecycleScope.launch(Dispatchers.Default) {
|
||||
Log.d("CODE", "---- 2 ------")
|
||||
speak(it, ttsContent)
|
||||
Log.d("CODE", "---- 3 ------")
|
||||
listener?.onShow()
|
||||
CallerLogger.d(
|
||||
"$M_HMI$TAG",
|
||||
"--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime"
|
||||
)
|
||||
lastShowV2XJob?.safeCancel()
|
||||
lifecycleScope.launch {
|
||||
delay(expireTime)
|
||||
}.also { itx ->
|
||||
lastSpeakJob.set(itx)
|
||||
lastShowV2XJob = itx
|
||||
}.invokeOnCompletion { _ ->
|
||||
listener?.onDismiss()
|
||||
showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
}
|
||||
|
||||
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
|
||||
val last = lastSpeakJob.get()
|
||||
Log.d("CODE", "---- 0 ------: last: $last")
|
||||
if (last != null && !last.isCompleted) {
|
||||
Log.d("CODE", "---- 1 ------")
|
||||
return@runOnUiThread
|
||||
}
|
||||
lifecycleScope.launch(Dispatchers.Default) {
|
||||
Log.d("CODE", "---- 2 ------")
|
||||
speak(it, ttsContent)
|
||||
Log.d("CODE", "---- 3 ------")
|
||||
}.also { itx ->
|
||||
lastSpeakJob.set(itx)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,13 +171,21 @@ class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
when (category) {
|
||||
MsgCategory.NOTICE -> {
|
||||
noticeList?.add(0,msgBoxList)
|
||||
if(MsgBoxConfig.getUserRecord() == 0){
|
||||
noticeList?.let { driverMsgBoxListAdapter?.setData(it) }
|
||||
}
|
||||
}
|
||||
MsgCategory.SYS_INFO -> {
|
||||
ipcReportList?.add(0,msgBoxList)
|
||||
if(MsgBoxConfig.getUserRecord() == 1){
|
||||
ipcReportList?.let { driverMsgBoxListAdapter?.setData(it) }
|
||||
}
|
||||
}
|
||||
MsgCategory.RECORD_BAG -> {
|
||||
badCaseList?.add(0,msgBoxList)
|
||||
badCaseList?.let { driverMsgBoxListAdapter?.setData(it) }
|
||||
if(MsgBoxConfig.getUserRecord() == 2){
|
||||
badCaseList?.let { driverMsgBoxListAdapter?.setData(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
@@ -28,9 +27,10 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
|
||||
* @description 司机端消息盒子列表视图RecyclerView适配器
|
||||
* @since: 2022/11/25
|
||||
*/
|
||||
class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Adapter<RecyclerView.ViewHolder>(){
|
||||
class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
|
||||
private var data: List<MsgBoxBean> ?= null
|
||||
private var data: List<MsgBoxBean>? = null
|
||||
|
||||
private val operation: Int = 1
|
||||
private val notice: Int = 2
|
||||
@@ -44,7 +44,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
val RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED"
|
||||
val RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE"
|
||||
|
||||
fun setData(data: List<MsgBoxBean>){
|
||||
fun setData(data: List<MsgBoxBean>) {
|
||||
this.data = data
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
@@ -52,27 +52,33 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||
when (viewType) {
|
||||
record -> {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_bad_case,parent,false)
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_bad_case, parent, false)
|
||||
return BadCaseHolder(view)
|
||||
}
|
||||
report -> {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_ipc_report,parent,false)
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_msg_box_ipc_report, parent, false)
|
||||
return MsgBoxIpcReportHolder(view)
|
||||
}
|
||||
operation -> {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_operation,parent,false)
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_msg_box_operation, parent, false)
|
||||
return MsgBoxOperation(view)
|
||||
}
|
||||
notice -> {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_notice,parent,false)
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_msg_box_notice, parent, false)
|
||||
return MsgBoxNotice(view)
|
||||
}
|
||||
summary -> {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_summary,parent,false)
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_msg_box_summary, parent, false)
|
||||
return MsgBoxSummary(view)
|
||||
}
|
||||
else -> {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_v2x,parent,false)
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_msg_box_v2x, parent, false)
|
||||
return MsgBoxV2X(view)
|
||||
}
|
||||
}
|
||||
@@ -83,53 +89,68 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
when (holder) {
|
||||
is BadCaseHolder -> {
|
||||
data?.let {
|
||||
holder.tvBagReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvBagRecordTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
holder.tvBagReceiveTime.text =
|
||||
TimeUtils.millis2String(it[position].timestamp, getHourMinFormat())
|
||||
holder.tvBagRecordTime.text =
|
||||
"时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
val msgBoxBean = it[position]
|
||||
holder.tvRecordCheck.setOnClickListener {
|
||||
//打开被动录包弹窗
|
||||
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,activity,false)
|
||||
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean, activity, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
is MsgBoxIpcReportHolder -> {
|
||||
data?.let { it ->
|
||||
holder.tvReportTimeNormal.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
holder.tvReportTimeOpen.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
holder.tvReportTimeNormal.text =
|
||||
"时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
holder.tvReportTimeOpen.text =
|
||||
"时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
val reportEntity = (it[position].bean as ReportEntity)
|
||||
if(reportEntity.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|
||||
if (reportEntity.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|
||||
|| reportEntity.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
|
||||
|| reportEntity.resultList.contains(RESULT_REMOTEPILOT_DISABLE)){
|
||||
|| reportEntity.resultList.contains(RESULT_REMOTEPILOT_DISABLE)
|
||||
) {
|
||||
//Error
|
||||
holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_error_normal))
|
||||
holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_error_open))
|
||||
holder.tvReportLevelNormal.text = "Error"
|
||||
holder.tvReportLevelOpen.text = "Error"
|
||||
}else{
|
||||
} else {
|
||||
//Warning
|
||||
holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_warning_normal))
|
||||
holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_warning_open))
|
||||
holder.tvReportLevelNormal.text = "Warning"
|
||||
holder.tvReportLevelOpen.text = "Warning"
|
||||
}
|
||||
holder.tvReportTimeNormal.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
holder.tvReportTimeOpen.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
holder.tvReportTime.text =TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvReportTimeNormal.text =
|
||||
"时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
holder.tvReportTimeOpen.text =
|
||||
"时间:${TimeUtils.millis2String(it[position].timestamp)}"
|
||||
holder.tvReportTime.text =
|
||||
TimeUtils.millis2String(it[position].timestamp, getHourMinFormat())
|
||||
var resultStr = "类型:"
|
||||
for (result in reportEntity.resultList){
|
||||
resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
|
||||
for (result in reportEntity.resultList) {
|
||||
resultStr =
|
||||
"${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
|
||||
}
|
||||
holder.tvReportTypeNormal.text = resultStr
|
||||
holder.tvReportTypeOpen.text = resultStr
|
||||
holder.tvReportReasonOpen.text = "原因:${reportEntity.msg}"
|
||||
var actionStr = ""
|
||||
for (action in reportEntity.actionsList){
|
||||
actionStr = "${actionStr}${CallerAutoPilotManager.getReportActionDesc(action)}"
|
||||
for (action in reportEntity.actionsList) {
|
||||
actionStr =
|
||||
"${actionStr}${CallerAutoPilotManager.getReportActionDesc(action)}"
|
||||
}
|
||||
holder.tvReportActionOpen.text = "建议操作:$actionStr"
|
||||
holder.tvStatusSelect.setOnClickListener {
|
||||
if(holder.tvReportLevelNormal.isVisible){
|
||||
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_close),null,null,null)
|
||||
if (holder.tvReportLevelNormal.isVisible) {
|
||||
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(
|
||||
getDrawable(R.drawable.icon_msg_close),
|
||||
null,
|
||||
null,
|
||||
null
|
||||
)
|
||||
holder.ivReportImageNormal.visibility = View.GONE
|
||||
holder.tvReportLevelNormal.visibility = View.GONE
|
||||
holder.tvReportTimeNormal.visibility = View.GONE
|
||||
@@ -141,8 +162,13 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
holder.tvReportTypeOpen.visibility = View.VISIBLE
|
||||
holder.tvReportReasonOpen.visibility = View.VISIBLE
|
||||
holder.tvReportActionOpen.visibility = View.VISIBLE
|
||||
}else{
|
||||
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_open),null,null,null)
|
||||
} else {
|
||||
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(
|
||||
getDrawable(R.drawable.icon_msg_open),
|
||||
null,
|
||||
null,
|
||||
null
|
||||
)
|
||||
holder.ivReportImageNormal.visibility = View.VISIBLE
|
||||
holder.tvReportLevelNormal.visibility = View.VISIBLE
|
||||
holder.tvReportTimeNormal.visibility = View.VISIBLE
|
||||
@@ -163,10 +189,16 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
val operationMsg = it[position].bean as OperationMsg
|
||||
holder.tvOperationContentNormal.text = operationMsg.content
|
||||
holder.tvOperationContentOpen.text = operationMsg.content
|
||||
holder.tvOperationTime.text = TimeUtils.millis2String(operationMsg.timestamp,getHourMinFormat())
|
||||
holder.tvOperationTime.text =
|
||||
TimeUtils.millis2String(operationMsg.timestamp, getHourMinFormat())
|
||||
holder.tvOperationStatusSelect.setOnClickListener {
|
||||
if(holder.ivOperationImageNormal.isVisible){
|
||||
holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_close),null,null,null)
|
||||
if (holder.ivOperationImageNormal.isVisible) {
|
||||
holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds(
|
||||
getDrawable(R.drawable.icon_msg_close),
|
||||
null,
|
||||
null,
|
||||
null
|
||||
)
|
||||
holder.ivOperationImageNormal.visibility = View.GONE
|
||||
holder.tvOperationTitleNormal.visibility = View.GONE
|
||||
holder.tvOperationContentNormal.visibility = View.GONE
|
||||
@@ -174,8 +206,13 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
holder.ivOperationImageOpen.visibility = View.VISIBLE
|
||||
holder.tvOperationTitleOpen.visibility = View.VISIBLE
|
||||
holder.tvOperationContentOpen.visibility = View.VISIBLE
|
||||
}else{
|
||||
holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_open),null,null,null)
|
||||
} else {
|
||||
holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds(
|
||||
getDrawable(R.drawable.icon_msg_open),
|
||||
null,
|
||||
null,
|
||||
null
|
||||
)
|
||||
holder.ivOperationImageNormal.visibility = View.VISIBLE
|
||||
holder.tvOperationTitleNormal.visibility = View.VISIBLE
|
||||
holder.tvOperationContentNormal.visibility = View.VISIBLE
|
||||
@@ -190,9 +227,10 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
is MsgBoxNotice -> {
|
||||
data?.let {
|
||||
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
|
||||
if(noticeFrCloudMsg.type == 0){
|
||||
if (noticeFrCloudMsg.type == 0) {
|
||||
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
|
||||
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvNoticeTime.text =
|
||||
TimeUtils.millis2String(it[position].timestamp, getHourMinFormat())
|
||||
holder.tvNoticeContent.text = noticeNormalData?.content
|
||||
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
@@ -204,19 +242,25 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
//云公告
|
||||
noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) }
|
||||
}
|
||||
}else if(noticeFrCloudMsg.type == 1){
|
||||
} else if (noticeFrCloudMsg.type == 1) {
|
||||
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
|
||||
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvNoticeTime.text =
|
||||
TimeUtils.millis2String(it[position].timestamp, getHourMinFormat())
|
||||
holder.tvNoticeContent.text = noticeTrafficStylePushData?.content
|
||||
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(holder.ivNoticeImage)
|
||||
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl)
|
||||
.optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(holder.ivNoticeImage)
|
||||
holder.tvNoticeCheck.setOnClickListener {
|
||||
//云公告
|
||||
noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) }
|
||||
noticeTrafficStylePushData?.let { it1 ->
|
||||
CallerHmiManager.showTrafficBanner(
|
||||
it1
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,21 +270,19 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
data?.let {
|
||||
val msgBoxBean = it[position]
|
||||
val v2XMsg = msgBoxBean.bean as V2XMsg
|
||||
holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvV2XTime.text =
|
||||
TimeUtils.millis2String(it[position].timestamp, getHourMinFormat())
|
||||
holder.tvV2XContent.text = v2XMsg.content
|
||||
if(msgBoxBean.type == MsgBoxType.OBU){
|
||||
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
|
||||
}else{
|
||||
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnum.getUpdateIconRes(v2XMsg.type)))
|
||||
}
|
||||
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))
|
||||
)
|
||||
}
|
||||
}
|
||||
is MsgBoxSummary -> {
|
||||
data?.let {
|
||||
val summaryMsg = it[position].bean as V2XMsg
|
||||
holder.tvSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvSummaryTime.text =
|
||||
TimeUtils.millis2String(it[position].timestamp, getHourMinFormat())
|
||||
holder.tvSummaryContent.text = summaryMsg.content
|
||||
}
|
||||
}
|
||||
@@ -251,30 +293,30 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
return if(data!![position].type == MsgBoxType.OPERATION){
|
||||
return if (data!![position].type == MsgBoxType.OPERATION) {
|
||||
operation
|
||||
}else if(data!![position].type == MsgBoxType.NOTICE){
|
||||
} else if (data!![position].type == MsgBoxType.NOTICE) {
|
||||
notice
|
||||
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
|
||||
} else if (data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY) {
|
||||
summary
|
||||
}else if(data!![position].type == MsgBoxType.REPORT){
|
||||
} else if (data!![position].type == MsgBoxType.REPORT) {
|
||||
report
|
||||
}else if(data!![position].type == MsgBoxType.RECORD){
|
||||
} else if (data!![position].type == MsgBoxType.RECORD) {
|
||||
record
|
||||
}else{
|
||||
} else {
|
||||
v2x
|
||||
}
|
||||
}
|
||||
|
||||
//录包实体
|
||||
class BadCaseHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var tvBagRecordTime: TextView= itemView.findViewById(R.id.tvBagRecordTime)
|
||||
class BadCaseHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var tvBagRecordTime: TextView = itemView.findViewById(R.id.tvBagRecordTime)
|
||||
var tvBagReceiveTime: TextView = itemView.findViewById(R.id.tvBagReceiveTime)
|
||||
var tvRecordCheck: TextView = itemView.findViewById(R.id.tvRecordCheck)
|
||||
}
|
||||
|
||||
//车辆系统信息
|
||||
class MsgBoxIpcReportHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
class MsgBoxIpcReportHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var ivReportImageNormal: ImageView = itemView.findViewById(R.id.ivReportImageNormal)
|
||||
var tvReportLevelNormal: TextView = itemView.findViewById(R.id.tvReportLevelNormal)
|
||||
var tvReportTimeNormal: TextView = itemView.findViewById(R.id.tvReportTimeNormal)
|
||||
@@ -290,10 +332,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
}
|
||||
|
||||
//运营平台
|
||||
class MsgBoxOperation(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
class MsgBoxOperation(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var ivOperationImageNormal: ImageView = itemView.findViewById(R.id.ivOperationImageNormal)
|
||||
var tvOperationTitleNormal: TextView = itemView.findViewById(R.id.tvOperationTitleNormal)
|
||||
var tvOperationContentNormal: TextView = itemView.findViewById(R.id.tvOperationContentNormal)
|
||||
var tvOperationContentNormal: TextView =
|
||||
itemView.findViewById(R.id.tvOperationContentNormal)
|
||||
var tvOperationStatusSelect: TextView = itemView.findViewById(R.id.tvOperationStatusSelect)
|
||||
var tvOperationTime: TextView = itemView.findViewById(R.id.tvOperationTime)
|
||||
var ivOperationImageOpen: ImageView = itemView.findViewById(R.id.ivOperationImageOpen)
|
||||
@@ -302,7 +345,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
}
|
||||
|
||||
//Notice
|
||||
class MsgBoxNotice(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
class MsgBoxNotice(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)
|
||||
var tvNoticeTitle: TextView = itemView.findViewById(R.id.tvNoticeTitle)
|
||||
var tvNoticeTime: TextView = itemView.findViewById(R.id.tvNoticeTime)
|
||||
@@ -311,14 +354,14 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
}
|
||||
|
||||
//V2X,OBU
|
||||
class MsgBoxV2X(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
class MsgBoxV2X(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var ivV2XImage: ImageView = itemView.findViewById(R.id.ivV2XImage)
|
||||
var tvV2XTime: TextView = itemView.findViewById(R.id.tvV2XTime)
|
||||
var tvV2XContent: TextView = itemView.findViewById(R.id.tvV2XContent)
|
||||
}
|
||||
|
||||
//汇总消息
|
||||
class MsgBoxSummary(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
class MsgBoxSummary(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var tvSummaryContent: TextView = itemView.findViewById(R.id.tvSummaryContent)
|
||||
var tvSummaryTime: TextView = itemView.findViewById(R.id.tvSummaryTime)
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
@@ -112,7 +113,8 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
|
||||
holder.tvPassengerSummaryContent.text = summaryMsg.content
|
||||
holder.tvPassengerSummaryCheck.setOnClickListener {
|
||||
//跳转全览模式
|
||||
CallerHmiManager.showSmallFragment()
|
||||
// CallerHmiManager.showSmallFragment()
|
||||
CallerMsgBoxEventListenerManager.invokeListener()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
@@ -104,7 +105,8 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A
|
||||
holder.tvPassengerSummaryContent.text = summaryMsg.content
|
||||
holder.tvPassengerSummaryCheck.setOnClickListener {
|
||||
//跳转全览模式
|
||||
CallerHmiManager.showSmallFragment()
|
||||
// CallerHmiManager.showSmallFragment()
|
||||
CallerMsgBoxEventListenerManager.invokeListener()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1148,7 +1148,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
*/
|
||||
tbObuWeaknessTraffic.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
|
||||
tbObuWeaknessTraffic.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (!isChecked) { //默认开启
|
||||
if (isChecked) { //默认开启
|
||||
CallerHmiManager.setObuWeaknessTraffic(true)
|
||||
} else {
|
||||
CallerHmiManager.setObuWeaknessTraffic(false)
|
||||
|
||||
@@ -9,6 +9,8 @@ import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
|
||||
@@ -19,10 +21,11 @@ import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener;
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario;
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
|
||||
import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -62,9 +65,9 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoMapL
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- show --- 1 --:\n" + (mMarkerEntity == null ? "null" : mMarkerEntity.toString()));
|
||||
if (mMarkerEntity != null) {
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- show --- 2 --:\n" + mMarkerEntity);
|
||||
int v2xType = getV2XTypeForFrontWarning(mMarkerEntity);
|
||||
String v2xType = getV2XTypeForFrontWarning(mMarkerEntity);
|
||||
V2XMessageEntity entity = getV2XMessageEntity();
|
||||
if (v2xType != 0) {
|
||||
if (!v2xType.equals("0")) {
|
||||
if (getAlertContentForFrontWarning(mMarkerEntity).toString() == null
|
||||
|| getAlertContentForFrontWarning(mMarkerEntity).toString().isEmpty()
|
||||
|| mMarkerEntity.getTts() == null || mMarkerEntity.getTts().isEmpty()) {
|
||||
@@ -86,19 +89,19 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoMapL
|
||||
}
|
||||
}
|
||||
|
||||
private int getV2XTypeForFrontWarning(V2XWarningTarget entity) {
|
||||
private String getV2XTypeForFrontWarning(V2XWarningTarget entity) {
|
||||
switch (entity.getType()) {
|
||||
case 1:
|
||||
case 11:
|
||||
entity.setTts("注意行人");
|
||||
return 0X2B0201;
|
||||
return EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.getPoiType();
|
||||
case 2:
|
||||
entity.setTts("注意自行车");
|
||||
case 4:
|
||||
entity.setTts("注意摩托车");
|
||||
return 0X2B0202;
|
||||
return EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.getPoiType();
|
||||
}
|
||||
return 0;
|
||||
return "0";
|
||||
}
|
||||
|
||||
private CharSequence getAlertContentForFrontWarning(V2XWarningTarget entity) {
|
||||
|
||||
Reference in New Issue
Block a user