1:修改初始的时候更改图标

This commit is contained in:
2025-09-19 19:04:47 +08:00
parent c446c7bb49
commit f12ed5ef84
14 changed files with 78 additions and 27 deletions

View File

@@ -219,6 +219,10 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
public void getUpRoomInfo(RoomInfoResp resp) {
this.roomInfoResp = resp;
// 确保适配器已初始化
if (easeChatAdapter == null) {
initChatAdapter();
}
easeChatAdapter.clearData();
// roomInfoResp = (RoomInfoResp) arguments.getSerializable("roomInfo");
toChatUsername = roomInfoResp.getRoom_info().getChatrooms();
@@ -234,7 +238,8 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
protected void initView() {
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
mBinding.recycleView.setLayoutManager(linearLayoutManager);
mBinding.recycleView.setAdapter(easeChatAdapter = new EaseChatAdapter());
initChatAdapter();
// mBinding.recycleView.setAdapter(easeChatAdapter = new EaseChatAdapter());
// easeChatAdapter.setOnItemChildClickListener((adapter, view, position) -> {
// EMMessageInfo item = easeChatAdapter.getItem(position);
// if (view.getId() == R.id.tv_red_rain_detail) { //点击红包结果详情
@@ -271,7 +276,17 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
mBinding.tvTabSystem.setOnClickListener(this::onClick);
}
/**
* 初始化聊天适配器
*/
private void initChatAdapter() {
if (easeChatAdapter == null) {
easeChatAdapter = new EaseChatAdapter();
if (mBinding.recycleView != null) {
mBinding.recycleView.setAdapter(easeChatAdapter);
}
}
}
private int isNumberWhether() {
if (roomInfoResp.getUser_info().getPit_number() == 9) {
return 1;