[Modify]消息頁面修改

This commit is contained in:
wushaocheng
2023-02-27 21:48:02 +08:00
parent ca21f61bab
commit 80f03bdcba
2 changed files with 32 additions and 5 deletions

View File

@@ -777,7 +777,7 @@ public class MessageListPanelEx {
private class MessageLoader implements BaseFetchLoadAdapter.RequestLoadMoreListener, BaseFetchLoadAdapter.RequestFetchMoreListener {
private int loadMsgCount = NimUIKitImpl.getOptions().messageCountLoadOnce;
private int loadMsgCount = getLoadMsgCount();
private QueryDirectionEnum direction = null;
@@ -855,6 +855,13 @@ public class MessageListPanelEx {
}
}
private int getLoadMsgCount(){
if(TextUtils.isEmpty(recordId)){
return NimUIKitImpl.getOptions().messageCountLoadOnce;
}else {
return 50;
}
}
/**
* 私聊聊天信息数(发起私聊限制需要用到)
@@ -939,6 +946,7 @@ public class MessageListPanelEx {
}
firstLoad = false;
loadMsgCount = NimUIKitImpl.getOptions().messageCountLoadOnce;
}
private void doScrollToPosition() {

View File

@@ -227,11 +227,11 @@ public class HallMsgViewHolder extends MsgViewHolderBase {
});
stvReject.setOnClickListener(view -> {
RefuseApplyDialog dialog = new RefuseApplyDialog(context);
if(info.getUrl().contains("hall/dealInvite")){
if (info.getUrl().contains("hall/dealInvite")) {
dialog.setIsInvite(false);
dialog.setTitleMsg(context.getString(R.string.refuse_invite));
dialog.setTipMsg(context.getString(R.string.sure_to_refuse_room_join_apply));
}else {
} else {
dialog.setIsInvite(true);
dialog.setTitleMsg(context.getString(R.string.refuse_apply));
dialog.setTipMsg(context.getString(R.string.sure_to_refuse_user_join_room));
@@ -240,9 +240,9 @@ public class HallMsgViewHolder extends MsgViewHolderBase {
@Override
public void onOk(Boolean isCheck) {
RefuseApplyDialog.OnActionListener.super.onOk(isCheck);
if(isCheck) {
if (isCheck) {
handleApply(info, second, -1);
}else {
} else {
handleApply(info, second, 0);
}
}
@@ -260,6 +260,25 @@ public class HallMsgViewHolder extends MsgViewHolderBase {
@Override
public void onErrorMsg(String error) {
SingleToastUtil.showToast(error);
if (error.equals("消息已過期")) {
info.setType(HallImMsgInfo.MSG_TYPE_OUT_OF_DATE);
setMsgTypeView(info, second);
Map<String, Object> localExtension = HallImMsgInfo.convertToMap(info);
message.setLocalExtension(localExtension);
updateMessageToLocal(info);
if (second == CustomAttachment.CUSTOM_MSG_SUB_HALL_MANAGER_INVITE) {
EventBus.getDefault().post(new HallInfoChangeEvent());
}
} else if (error.equals("消息已處理")) {
info.setType(HallImMsgInfo.MSG_TYPE_HAS_HANDLE);
setMsgTypeView(info, second);
Map<String, Object> localExtension = HallImMsgInfo.convertToMap(info);
message.setLocalExtension(localExtension);
updateMessageToLocal(info);
if (second == CustomAttachment.CUSTOM_MSG_SUB_HALL_MANAGER_INVITE) {
EventBus.getDefault().post(new HallInfoChangeEvent());
}
}
}
@Override