[2.14.0]消息盒子

This commit is contained in:
xuxinchao
2023-02-13 18:33:41 +08:00
parent 30cf22ab6c
commit 1829d191de
2 changed files with 13 additions and 0 deletions

View File

@@ -250,6 +250,7 @@ class DriverMsgBoxListView @JvmOverloads constructor(
notifyData()
ipcReportList?.let {
linearLayoutManager?.scrollToPositionWithOffset(it.indexOf(msgBoxBean),0)
driverMsgBoxListAdapter?.setReportShowData(msgBoxBean)
}
}
}

View File

@@ -31,6 +31,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private var data: List<MsgBoxBean>? = null
private var reportBean: MsgBoxBean ?= null
private val operation: Int = 1
private val notice: Int = 2
@@ -49,6 +50,10 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
notifyDataSetChanged()
}
fun setReportShowData(reportClickBean: MsgBoxBean){
reportBean = reportClickBean
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
when (viewType) {
record -> {
@@ -102,6 +107,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
}
is MsgBoxIpcReportHolder -> {
data?.let { it ->
val reportMsgBox = it[position]
holder.tvReportTimeNormal.text =
"时间:${TimeUtils.millis2String(it[position].timestamp)}"
holder.tvReportTimeOpen.text =
@@ -182,6 +188,12 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
holder.tvReportActionOpen.visibility = View.GONE
}
}
reportBean?.let {
if(reportMsgBox.timestamp == it.timestamp){
holder.tvStatusSelect.performClick()
}
}
}
}
is MsgBoxOperation -> {