|  | @@ -10,17 +10,21 @@ import android.widget.TextView;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.alibaba.android.arouter.launcher.ARouter;
 | 
	
		
			
				|  |  |  import com.common.im.adapter.MessagePagerAdapter;
 | 
	
		
			
				|  |  | +import com.common.im.bean.GroupUserInfoBean;
 | 
	
		
			
				|  |  |  import com.common.im.contract.MessageFragmentContract;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import io.rong.imkit.userinfo.model.GroupUserInfo;
 | 
	
		
			
				|  |  |  import io.rong.imkit.utils.helper.ConversationFilterHelper;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  import com.common.im.presenter.MessagePresenter;
 | 
	
		
			
				|  |  |  import com.common.im.ui.contact.ContactListTabFragment;
 | 
	
		
			
				|  |  | +import io.rong.imkit.utils.GroupUtils;
 | 
	
		
			
				|  |  |  import com.common.im_ui.R;
 | 
	
		
			
				|  |  |  import com.common.im_ui.databinding.FragmentMessageLayoutBinding;
 | 
	
		
			
				|  |  |  import com.common.im.bean.RongIMGroupInfo;
 | 
	
		
			
				|  |  |  import com.common.im.bean.RongIMUserInfo;
 | 
	
		
			
				|  |  |  import com.cooleshow.base.common.BaseApplication;
 | 
	
		
			
				|  |  |  import com.cooleshow.base.router.RouterPath;
 | 
	
		
			
				|  |  | -import com.cooleshow.base.utils.LogUtils;
 | 
	
		
			
				|  |  |  import com.cooleshow.base.utils.Utils;
 | 
	
		
			
				|  |  |  import com.cooleshow.base.ui.fragment.BaseMVPFragment;
 | 
	
		
			
				|  |  |  import com.cooleshow.usercenter.helper.UserHelper;
 | 
	
	
		
			
				|  | @@ -54,7 +58,7 @@ public class MessageFragment extends BaseMVPFragment<FragmentMessageLayoutBindin
 | 
	
		
			
				|  |  |          Utils.setHeadView(mViewBinding.viewStatusBar, requireContext(), 0);
 | 
	
		
			
				|  |  |          if (!BaseApplication.Companion.isTeacherClient()) {
 | 
	
		
			
				|  |  |              mViewBinding.imCreateGroup.setVisibility(View.GONE);
 | 
	
		
			
				|  |  | -        }else{
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  |              mViewBinding.imCreateGroup.setVisibility(View.VISIBLE);
 | 
	
		
			
				|  |  |              mViewBinding.imCreateGroup.setOnClickListener(this);
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -74,9 +78,9 @@ public class MessageFragment extends BaseMVPFragment<FragmentMessageLayoutBindin
 | 
	
		
			
				|  |  |                      tv_text.setTextColor(getResources().getColor(com.cooleshow.base.R.color.color_333333));
 | 
	
		
			
				|  |  |                      tv_text.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                if(tab != null && tab.getPosition() == 1){
 | 
	
		
			
				|  |  | +                if (tab != null && tab.getPosition() == 1) {
 | 
	
		
			
				|  |  |                      ContactListTabFragment fragment = (ContactListTabFragment) fragments.get(tab.getPosition());
 | 
	
		
			
				|  |  | -                    if(fragment!=null){
 | 
	
		
			
				|  |  | +                    if (fragment != null) {
 | 
	
		
			
				|  |  |                          fragment.refreshContactList();
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
	
		
			
				|  | @@ -96,18 +100,31 @@ public class MessageFragment extends BaseMVPFragment<FragmentMessageLayoutBindin
 | 
	
		
			
				|  |  |              public void onTabReselected(TabLayout.Tab tab) {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  | +        RongIM.setGroupUserInfoProvider(new UserDataProvider.GroupUserInfoProvider() {
 | 
	
		
			
				|  |  | +            @Override
 | 
	
		
			
				|  |  | +            public GroupUserInfo getGroupUserInfo(String groupId, String userId) {
 | 
	
		
			
				|  |  | +                if (!TextUtils.isEmpty(groupId) && !TextUtils.isEmpty(userId)) {
 | 
	
		
			
				|  |  | +                    if (presenter != null) {
 | 
	
		
			
				|  |  | +                        presenter.queryGroupFriendDetail(groupId, userId);
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                return null;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }, true);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          RongIM.setUserInfoProvider(new UserDataProvider.UserInfoProvider() {
 | 
	
		
			
				|  |  |              @Override
 | 
	
		
			
				|  |  |              public UserInfo getUserInfo(String userId) {
 | 
	
		
			
				|  |  |                  if (!TextUtils.isEmpty(localUserid) && localUserid.equals(userId)) {
 | 
	
		
			
				|  |  |                      RongIMUserInfo data = new RongIMUserInfo();
 | 
	
		
			
				|  |  | -                    data.setFriendId(userId+"");
 | 
	
		
			
				|  |  | +                    data.setFriendId(userId + "");
 | 
	
		
			
				|  |  |                      data.setFriendNickname(UserHelper.getUserName());
 | 
	
		
			
				|  |  |                      data.setFriendAvatar(UserHelper.getUserAvatar());
 | 
	
		
			
				|  |  |                      onQueryFriendDetail(data);
 | 
	
		
			
				|  |  |                  } else {
 | 
	
		
			
				|  |  |                      if (presenter != null) {
 | 
	
		
			
				|  |  | -                        presenter.queryFriendDetail(getContext(),userId);
 | 
	
		
			
				|  |  | +                        presenter.queryFriendDetail(getContext(), userId);
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  }
 | 
	
	
		
			
				|  | @@ -123,7 +140,7 @@ public class MessageFragment extends BaseMVPFragment<FragmentMessageLayoutBindin
 | 
	
		
			
				|  |  |                      return null;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  if (presenter != null) {
 | 
	
		
			
				|  |  | -                    presenter.queryGroupDetail(getContext(),groupId);
 | 
	
		
			
				|  |  | +                    presenter.queryGroupDetail(getContext(), groupId);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  return null;
 | 
	
	
		
			
				|  | @@ -134,9 +151,11 @@ public class MessageFragment extends BaseMVPFragment<FragmentMessageLayoutBindin
 | 
	
		
			
				|  |  |                      conversationType, String targetId) {
 | 
	
		
			
				|  |  |                  return false;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              public boolean onConversationPortraitLongClick(Context context, Conversation.ConversationType conversationType, String targetId) {
 | 
	
		
			
				|  |  |                  return false;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              @Override
 | 
	
		
			
				|  |  |              public boolean onConversationLongClick(Context context, View view, BaseUiConversation conversation) {
 | 
	
		
			
				|  |  |                  return false;
 | 
	
	
		
			
				|  | @@ -146,7 +165,7 @@ public class MessageFragment extends BaseMVPFragment<FragmentMessageLayoutBindin
 | 
	
		
			
				|  |  |              public boolean onConversationClick(Context context, View view, BaseUiConversation conversation) {
 | 
	
		
			
				|  |  |                  if (null != presenter && TextUtils.isEmpty(conversation.mCore.getConversationTitle())) {
 | 
	
		
			
				|  |  |                      if (conversation.mCore.getConversationType() == Conversation.ConversationType.GROUP) {
 | 
	
		
			
				|  |  | -                        presenter.queryGroupDetail(getContext(),conversation.mCore.getTargetId());
 | 
	
		
			
				|  |  | +                        presenter.queryGroupDetail(getContext(), conversation.mCore.getTargetId());
 | 
	
		
			
				|  |  |                      } else {
 | 
	
		
			
				|  |  |                          String userId = conversation.mCore.getTargetId();
 | 
	
		
			
				|  |  |                          if (localUserid.equals(userId)) {
 | 
	
	
		
			
				|  | @@ -156,7 +175,7 @@ public class MessageFragment extends BaseMVPFragment<FragmentMessageLayoutBindin
 | 
	
		
			
				|  |  |                              data.setFriendAvatar(UserHelper.getUserAvatar());
 | 
	
		
			
				|  |  |                              onQueryFriendDetail(data);
 | 
	
		
			
				|  |  |                          } else {
 | 
	
		
			
				|  |  | -                            presenter.queryFriendDetail(getContext(),userId);
 | 
	
		
			
				|  |  | +                            presenter.queryFriendDetail(getContext(), userId);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
	
		
			
				|  | @@ -167,7 +186,7 @@ public class MessageFragment extends BaseMVPFragment<FragmentMessageLayoutBindin
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          ConversationListFragment conversationListFragment = new ConversationListFragment();
 | 
	
		
			
				|  |  |  //        ContactPersonListFragment contactPersonListFragment = new ContactPersonListFragment();
 | 
	
		
			
				|  |  | -        ContactListTabFragment contactListTabFragment=new ContactListTabFragment();
 | 
	
		
			
				|  |  | +        ContactListTabFragment contactListTabFragment = new ContactListTabFragment();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          fragments.add(conversationListFragment);
 | 
	
		
			
				|  |  |          fragments.add(contactListTabFragment);
 | 
	
	
		
			
				|  | @@ -190,6 +209,14 @@ public class MessageFragment extends BaseMVPFragment<FragmentMessageLayoutBindin
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public void onQueryGroupUserInfoSuccess(GroupUserInfoBean userInfoBean) {
 | 
	
		
			
				|  |  | +        if (userInfoBean != null) {
 | 
	
		
			
				|  |  | +            GroupUserInfo groupUserInfo = new GroupUserInfo(userInfoBean.groupId, userInfoBean.userId, userInfoBean.nickname, GroupUtils.getGroupUserInfoExtra(userInfoBean.isAdmin));
 | 
	
		
			
				|  |  | +            RongIM.getInstance().refreshGroupUserInfoCache(groupUserInfo);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      private TabLayout.Tab createTab(TabLayout.Tab tab, String text) {
 | 
	
		
			
				|  |  |          View view = LayoutInflater.from(getContext()).inflate(R.layout.view_message_tab_layout, null);
 | 
	
		
			
				|  |  |          TextView tv_text = view.findViewById(R.id.tv_text);
 |