Browse Source

1、修复消息列表刷新无效问题;

yzs 4 years ago
parent
commit
9a10fce7cb

+ 4 - 3
uchat_im/src/main/java/com/shanp/youqi/im/adapter/MessageListAdapter.java

@@ -99,17 +99,18 @@ public class MessageListAdapter extends BaseQuickAdapter<ConversationListVo, Bas
                 Conversation conversation = vo.getConversation();
                 Conversation conversation = vo.getConversation();
                 if (conversation == null) return;
                 if (conversation == null) return;
                 TextView tvCount = helper.getView(R.id.tv_item_msg_count);
                 TextView tvCount = helper.getView(R.id.tv_item_msg_count);
-                getUnReadCount(conversation.getConversationType(), conversation.getTargetId(), tvCount);
+                getUnReadCount(conversation, tvCount);
             }
             }
         }
         }
     }
     }
 
 
-    public void getUnReadCount(Conversation.ConversationType type, String id, TextView tvCount) {
+    private void getUnReadCount(Conversation conversation, TextView tvCount) {
         if (!AppManager.get().isConnectRongCloud()) return;
         if (!AppManager.get().isConnectRongCloud()) return;
-        RongIMClient.getInstance().getUnreadCount(type, id, new RongIMClient.ResultCallback<Integer>() {
+        RongIMClient.getInstance().getUnreadCount(conversation.getConversationType(), conversation.getTargetId(), new RongIMClient.ResultCallback<Integer>() {
             @Override
             @Override
             public void onSuccess(Integer count) {
             public void onSuccess(Integer count) {
                 if (count != null) {
                 if (count != null) {
+                    conversation.setUnreadMessageCount(count);
                     String num;
                     String num;
                     if (count > 99) {
                     if (count > 99) {
                         num = "99+";
                         num = "99+";