chat页设置adapter
This commit is contained in:
parent
a50e97f2ed
commit
1e5d8ab709
@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
|
@ -13,9 +13,10 @@ import com.tenlionsoft.aimz_k.databinding.ItemMsgOtherImgBinding
|
||||
import com.tenlionsoft.aimz_k.databinding.ItemMsgOtherVideoBinding
|
||||
import com.tenlionsoft.aimz_k.model.MsgBean
|
||||
import com.tenlionsoft.aimz_k.model.MsgTypeStateEnum
|
||||
import com.tenlionsoft.aimz_k.viewmodel.ChatPageViewModel
|
||||
import com.tenlionsoft.baselib.base.BaseBindingAdapter
|
||||
|
||||
class ChatMsgAdapter(var datas: List<MsgBean>) :
|
||||
class ChatMsgAdapter(datas: List<MsgBean>, viewModel: ChatPageViewModel) :
|
||||
BaseBindingAdapter<MsgBean, ViewDataBinding>(datas) {
|
||||
|
||||
override fun getItemBinding(parent: ViewGroup, viewType: Int): ViewDataBinding {
|
||||
|
@ -10,9 +10,11 @@ import com.atwa.filepicker.result.ImageMeta
|
||||
import com.atwa.filepicker.result.VideoMeta
|
||||
import com.google.gson.Gson
|
||||
import com.tenlionsoft.aimz_k.ConvertBeanUtils
|
||||
import com.tenlionsoft.aimz_k.adapter.ChatMsgAdapter
|
||||
import com.tenlionsoft.aimz_k.model.BodyContent
|
||||
import com.tenlionsoft.aimz_k.model.CoverSealedBean
|
||||
import com.tenlionsoft.aimz_k.model.DbManager
|
||||
import com.tenlionsoft.aimz_k.model.MsgBean
|
||||
import com.tenlionsoft.aimz_k.model.MsgConvertBean
|
||||
import com.tenlionsoft.aimz_k.model.PickerType
|
||||
import com.tenlionsoft.aimz_k.model.Receiver
|
||||
@ -32,6 +34,8 @@ class ChatPageViewModel : BaseViewModel() {
|
||||
val showReplyLayout = MutableLiveData(false)//显示/隐藏快速回复
|
||||
val showChooseLayout = MutableLiveData(false)//显示/隐藏选择
|
||||
val chooseType = MutableLiveData<PickerType>()//选择文件类型
|
||||
private val _msgList = MutableLiveData<List<MsgBean>>()
|
||||
var adapter: ChatMsgAdapter = ChatMsgAdapter(_msgList.value ?: emptyList(),this)
|
||||
private val mGson: Gson = Gson()
|
||||
|
||||
init {
|
||||
|
@ -75,8 +75,10 @@
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_chats"
|
||||
setAdapter="@{viewModel.adapter}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
tools:listitem="@layout/item_msg_my" />
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
Loading…
Reference in New Issue
Block a user