Commit f785c8bc by 刘鹏

feat : im聊天列表删除更新列表

parent ba0b1574
......@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.03",
"m-user" : "0.0.61.68",
"m-home" : "0.0.22.70",
"m-im" : "0.0.19.86",
"m-im" : "0.0.19.87",
"m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.10",
......@@ -93,7 +93,7 @@ ext {
"m-fm" : "0.0.30.01",
"m-user" : "0.0.61.68",
"m-home" : "0.0.22.70",
"m-im" : "0.0.19.86",
"m-im" : "0.0.19.87",
"m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.8",
......
......@@ -14,6 +14,7 @@ import com.ydl.ydlcommon.utils.StatusBarUtils.Companion.statusBarLightMode
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R
import com.yidianling.im.event.MessageListRefreshEvent
import com.yidianling.im.event.UpdateTabUnreadNumEvent
import com.yidianling.im.helper.MsgReceiveHelper
import com.yidianling.im.http.ImHttpImpl
import com.yidianling.im.router.ImIn
......@@ -27,6 +28,7 @@ import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.im_chat_fragment_layout.*
import kotlinx.android.synthetic.main.im_chat_fragment_layout.chat_recyclerview
import kotlinx.android.synthetic.main.im_chat_fragment_layout.ll_chat_unusual_view
import kotlinx.android.synthetic.main.im_new_multi_message_fragment.*
import kotlinx.android.synthetic.main.medical_chat_list.*
@Route(path = "/im/medical")
......@@ -58,6 +60,8 @@ class MedicalChatActivity : BaseActivity(), XRecyclerView.LoadingListener {
}
override fun initDataAndEvent() {
EventBus.getDefault().register(this)
initStatus()
chatAdapter = ChatAdapter(mContext, showData, this@MedicalChatActivity)
chatAdapter?.setlistener(object : ChatAdapter.ChatRecyclerViewCallback {
......@@ -94,6 +98,12 @@ class MedicalChatActivity : BaseActivity(), XRecyclerView.LoadingListener {
getChatMessageData()
}
override fun onDestroy() {
super.onDestroy()
EventBus.getDefault().unregister(this)
}
fun clearData() {
showData.clear()
chatAdapter?.notifyDataSetChanged()
......@@ -209,4 +219,12 @@ class MedicalChatActivity : BaseActivity(), XRecyclerView.LoadingListener {
allChatData.topData.data.addAll(allChatData.before.data.filter { it.is_top == 1 })
allChatData.topData.data.addAll(allChatData.nomal.data.filter { it.is_top == 1 })
}
/**
* 私聊未读数变化触发的事件,不进行互动和通知未读数的更新
*/
fun onEvent(event: UpdateTabUnreadNumEvent) {
getChatMessageData()
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment