[Modify]修復消息列表bug
This commit is contained in:
@@ -72,6 +72,7 @@ import com.yizhuan.erban.R;
|
||||
import com.yizhuan.xchat_android_core.module_hall.im.HallAttachment;
|
||||
import com.yizhuan.xchat_android_core.module_hall.im.HallImMsgInfo;
|
||||
import com.yizhuan.xchat_android_core.room.event.MessageSizeEvent;
|
||||
import com.yizhuan.xchat_android_core.utils.Logger;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
@@ -529,7 +530,7 @@ public class MessageListPanelEx {
|
||||
if (message.getAttachment() instanceof HallAttachment) {
|
||||
HallAttachment attachment = (HallAttachment) message.getAttachment();
|
||||
HallImMsgInfo info = attachment.getHallImMsgInfo();
|
||||
if (info != null && info.getUrl() != null) {
|
||||
if (info != null && info.getUrl() != null && info.getUrl().contains("recordId")) {
|
||||
Uri uri = Uri.parse(info.getUrl());
|
||||
String record = uri.getQueryParameter("recordId");
|
||||
if (recordId.equals(record)) {
|
||||
@@ -947,9 +948,10 @@ public class MessageListPanelEx {
|
||||
if (firstLoad) {
|
||||
doScrollToBottom();
|
||||
sendReceipt(); // 发送已读回执
|
||||
if (!TextUtils.isEmpty(recordId) && !isShowAnim) {
|
||||
doScrollToPosition();
|
||||
}
|
||||
}
|
||||
|
||||
if (!TextUtils.isEmpty(recordId) && !isShowAnim) {
|
||||
doScrollToPosition();
|
||||
}
|
||||
|
||||
firstLoad = false;
|
||||
@@ -961,8 +963,12 @@ public class MessageListPanelEx {
|
||||
@Override
|
||||
public void run() {
|
||||
int index = getApplyItemIndex(recordId);
|
||||
if(index == -1){
|
||||
messageListView.scrollToPosition(0);
|
||||
return;
|
||||
}
|
||||
if (index >= 0 && index < items.size()) {
|
||||
messageListView.scrollToPosition(index);
|
||||
messageListView.scrollToPosition(adapter.getHeaderLayoutCount()+index);
|
||||
messageListView.post(() -> {
|
||||
RecyclerView.LayoutManager layoutManager = messageListView.getLayoutManager();
|
||||
if (layoutManager != null) {
|
||||
|
Reference in New Issue
Block a user