|
@@ -10,6 +10,8 @@ import com.swago.baseswago.dialog.BaseXDFragment
|
|
import com.swago.baseswago.util.NoDoubleClickListener
|
|
import com.swago.baseswago.util.NoDoubleClickListener
|
|
import com.swago.room.databinding.DialogMessageListBinding
|
|
import com.swago.room.databinding.DialogMessageListBinding
|
|
import com.tencent.imsdk.v2.V2TIMConversation
|
|
import com.tencent.imsdk.v2.V2TIMConversation
|
|
|
|
+import com.tencent.qcloud.tim.uikit.modules.conversation.ConversationLayout
|
|
|
|
+import com.tencent.qcloud.tim.uikit.modules.conversation.ConversationManagerKit
|
|
|
|
|
|
/**
|
|
/**
|
|
*@date 2021/11/11 21:03
|
|
*@date 2021/11/11 21:03
|
|
@@ -17,33 +19,41 @@ import com.tencent.imsdk.v2.V2TIMConversation
|
|
*/
|
|
*/
|
|
class MessageListDialog : BaseXDFragment<DialogMessageListBinding>() {
|
|
class MessageListDialog : BaseXDFragment<DialogMessageListBinding>() {
|
|
|
|
|
|
- override fun onActivityCreated(savedInstanceState: Bundle?) {
|
|
|
|
- super.onActivityCreated(savedInstanceState)
|
|
|
|
|
|
+ init {
|
|
setDimAmount(0f)
|
|
setDimAmount(0f)
|
|
- setHeightMatchParent()
|
|
|
|
setGravity(Gravity.BOTTOM)
|
|
setGravity(Gravity.BOTTOM)
|
|
}
|
|
}
|
|
|
|
|
|
- override fun initOther() {
|
|
|
|
- binding.conversation.initDefault()
|
|
|
|
- binding.conversation.conversationList.setOnItemClickListener { view, position, messageInfo ->
|
|
|
|
- ARouter.getInstance().build(ARouteConstant.Home.chatDetail)
|
|
|
|
- .withInt("type", V2TIMConversation.V2TIM_C2C)
|
|
|
|
- .withString("account",messageInfo.id)
|
|
|
|
- .withString("chatName",messageInfo.title).navigation()
|
|
|
|
- }
|
|
|
|
|
|
+ companion object{
|
|
|
|
+ fun newInstance(): MessageListDialog {
|
|
|
|
+ val args = Bundle()
|
|
|
|
+ val fragment = MessageListDialog()
|
|
|
|
+ fragment.arguments = args
|
|
|
|
+ return fragment
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- binding.conversation.conversationList.setOnItemLongClickListener { view, position, messageInfo ->
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ override fun initOther() {
|
|
|
|
+ activity?.let {
|
|
|
|
+ binding.conversation.initDefault()
|
|
|
|
+ binding.conversation.conversationList.setOnItemClickListener { view, position, messageInfo ->
|
|
|
|
+ ARouter.getInstance().build(ARouteConstant.Home.chatDetail)
|
|
|
|
+ .withInt("type", V2TIMConversation.V2TIM_C2C)
|
|
|
|
+ .withString("account",messageInfo.id)
|
|
|
|
+ .withString("chatName",messageInfo.title).navigation()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ binding.conversation.conversationList.setOnItemLongClickListener { view, position, messageInfo ->
|
|
|
|
|
|
- binding.cl.setOnClickListener(object : NoDoubleClickListener() {
|
|
|
|
- override fun onClick() {
|
|
|
|
- dismissAllowingStateLoss()
|
|
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
override fun initLiveData() {}
|
|
override fun initLiveData() {}
|
|
-
|
|
|
|
|
|
+ override fun onDestroyView() {
|
|
|
|
+ ConversationManagerKit.getInstance().detachAdapter()
|
|
|
|
+ super.onDestroyView()
|
|
|
|
+ }
|
|
}
|
|
}
|