diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt index 8592c0bcb3..948d93eaec 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt @@ -33,6 +33,8 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A private var data: ArrayList ?= null private val operation: Int = 1 + private val operationReturn: Int = 10 + private val operationStop: Int = 11 private val notice: Int = 2 private val v2x: Int = 3 private val report: Int = 4 @@ -55,6 +57,16 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_operation,parent,false) return BubbleOperationHolder(view) } + operationReturn -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_bubble_operation_return, parent, false) + return BubbleOperationReturnHolder(view) + } + operationStop -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_bubble_operation_stop, parent, false) + return BubbleOperationStopHolder(view) + } report -> { val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_report,parent,false) return BubbleReportHolder(view) @@ -87,6 +99,23 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A } } } + //运营平台还车通知 + is BubbleOperationReturnHolder -> { + data?.let { + val operationReturnMsg = it[position].bean as OperationMsg + holder.tvOperationReturnContent.text = operationReturnMsg.content + holder.tvOperationReturnTime.text = + TimeUtils.millis2String(operationReturnMsg.timestamp, getHourMinFormat()) + } + } + //运营平台靠边停车 + is BubbleOperationStopHolder -> { + data?.let { + val operationStopMsg = it[position].bean as OperationMsg + holder.tvOperationStopTime.text = + TimeUtils.millis2String(operationStopMsg.timestamp, getHourMinFormat()) + } + } is BubbleReportHolder -> { data?.let { val msgBoxBean = it[position] @@ -187,7 +216,16 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A override fun getItemViewType(position: Int): Int { return if(data!![position].type == MsgBoxType.OPERATION){ - operation + if((data!![position].bean as OperationMsg).type == 0){ + //运营平台还车通知 + operationReturn + }else if((data!![position].bean as OperationMsg).type == 1){ + //运营平台靠边停车 + operationStop + }else{ + //普通运营平台 + operation + } }else if(data!![position].type == MsgBoxType.REPORT){ report }else if(data!![position].type == MsgBoxType.NOTICE){ @@ -214,6 +252,17 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A var clBubbleOperationLayout: RoundCanClickConstraintLayout = itemView.findViewById(R.id.clBubbleOperationLayout) } + //运营平台还车通知 + class BubbleOperationReturnHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var tvOperationReturnTime: TextView = itemView.findViewById(R.id.tvOperationReturnTime) + var tvOperationReturnContent: TextView = itemView.findViewById(R.id.tvOperationReturnContent) + } + + //运营平台靠边停车通知 + class BubbleOperationStopHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var tvOperationStopTime: TextView = itemView.findViewById(R.id.tvOperationStopTime) + } + //Notice class BubbleNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){ var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt index 95ea8caef9..b020fd0ee7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt @@ -35,6 +35,8 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : private var reportBean: MsgBoxBean ?= null private val operation: Int = 1 + private val operationReturn: Int = 10 + private val operationStop: Int = 11 private val notice: Int = 2 private val v2x: Int = 3 private val report: Int = 5 @@ -72,6 +74,16 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : .inflate(R.layout.item_msg_box_operation, parent, false) return MsgBoxOperation(view) } + operationReturn -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_box_operation_return, parent, false) + return MsgBoxOperationReturn(view) + } + operationStop -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_box_operation_stop, parent, false) + return MsgBoxOperationStop(view) + } notice -> { val view = LayoutInflater.from(parent.context) .inflate(R.layout.item_msg_box_notice, parent, false) @@ -244,6 +256,23 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : } } } + //运营平台还车通知 + is MsgBoxOperationReturn -> { + data?.let { + val operationReturnMsg = it[position].bean as OperationMsg + holder.tvOperationReturnContent.text = operationReturnMsg.content + holder.tvOperationReturnTime.text = + TimeUtils.millis2String(operationReturnMsg.timestamp, getHourMinFormat()) + } + } + //运营平台靠边停车 + is MsgBoxOperationStop -> { + data?.let { + val operationStopMsg = it[position].bean as OperationMsg + holder.tvOperationStopTime.text = + TimeUtils.millis2String(operationStopMsg.timestamp, getHourMinFormat()) + } + } is MsgBoxNotice -> { data?.let { val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg @@ -314,7 +343,16 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : override fun getItemViewType(position: Int): Int { return if (data!![position].type == MsgBoxType.OPERATION) { - operation + if((data!![position].bean as OperationMsg).type == 0){ + //运营平台还车通知 + operationReturn + }else if((data!![position].bean as OperationMsg).type == 1){ + //运营平台靠边停车 + operationStop + }else{ + //普通运营平台 + operation + } } else if (data!![position].type == MsgBoxType.NOTICE) { notice } else if (data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY) { @@ -365,6 +403,17 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : var tvOperationContentOpen: TextView = itemView.findViewById(R.id.tvOperationContentOpen) } + //运营平台还车通知 + class MsgBoxOperationReturn(itemView: View) : RecyclerView.ViewHolder(itemView){ + var tvOperationReturnTime: TextView = itemView.findViewById(R.id.tvOperationReturnTime) + var tvOperationReturnContent: TextView = itemView.findViewById(R.id.tvOperationReturnContent) + } + + //运营平台靠边停车通知 + class MsgBoxOperationStop(itemView: View) : RecyclerView.ViewHolder(itemView){ + var tvOperationStopTime: TextView = itemView.findViewById(R.id.tvOperationStopTime) + } + //Notice class MsgBoxNotice(itemView: View) : RecyclerView.ViewHolder(itemView) { var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation_return.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation_return.png new file mode 100644 index 0000000000..d1363d1a96 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation_return.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation_stop.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation_stop.png new file mode 100644 index 0000000000..1ba1c633ec Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation_stop.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation_return.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation_return.xml new file mode 100644 index 0000000000..dd210d1341 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation_return.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation_stop.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation_stop.xml new file mode 100644 index 0000000000..bae20dc545 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation_stop.xml @@ -0,0 +1,54 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation_return.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation_return.xml new file mode 100644 index 0000000000..224dc865f1 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation_return.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation_stop.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation_stop.xml new file mode 100644 index 0000000000..e6b647840f --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation_stop.xml @@ -0,0 +1,52 @@ + + + + + + + + + + \ No newline at end of file