Pārlūkot izejas kodu

修改部分问题

Pq 2 gadi atpakaļ
vecāks
revīzija
93cc89a301

+ 4 - 0
chatModule/src/main/java/com/cooleshow/chatmodule/manager/IMCenter.java

@@ -173,4 +173,8 @@ public class IMCenter {
                 .withString(UserConstants.PHONE_NUM_KEY, UserHelper.getUserPhone())
                 .navigation();
     }
+
+    public void quitGroup(String groupId, V2TIMCallback callBack){
+        V2TIMManager.getInstance().quitGroup(groupId,callBack);
+    }
 }

+ 17 - 2
chatModule/src/main/java/com/cooleshow/chatmodule/presenter/ChatGroupSettingPresenter.java

@@ -16,6 +16,7 @@ import com.cooleshow.chatmodule.contract.ChatGroupSettingContract;
 import com.cooleshow.chatmodule.manager.IMCenter;
 import com.tencent.imsdk.conversation.Conversation;
 import com.tencent.imsdk.conversation.ConversationManager;
+import com.tencent.imsdk.v2.V2TIMCallback;
 import com.tencent.qcloud.tuicore.util.ToastUtil;
 import com.tencent.qcloud.tuikit.timcommon.component.interfaces.IUIKitCallback;
 import com.tencent.qcloud.tuikit.tuigroup.bean.GroupInfo;
@@ -121,6 +122,20 @@ public class ChatGroupSettingPresenter extends BasePresenter<ChatGroupSettingCon
         addSubscribe(create(IMApi.class).quitChatGroup(groupId, BaseConstant.CLIENT_API_GROUP_NAME), new BaseObserver<Object>() {
             @Override
             protected void onSuccess(Object data) {
+                quitGroup(groupId);
+            }
+
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+            }
+        });
+    }
+
+    public void quitGroup(String groupId) {
+        IMCenter.getInstance().quitGroup(groupId, new V2TIMCallback() {
+            @Override
+            public void onSuccess() {
                 if (getView() != null) {
                     getView().quitChatGroupSuccess();
                 }
@@ -128,8 +143,8 @@ public class ChatGroupSettingPresenter extends BasePresenter<ChatGroupSettingCon
             }
 
             @Override
-            public void onError(Throwable e) {
-                super.onError(e);
+            public void onError(int i, String s) {
+                ToastUtil.toastShortMessage("退出群聊失败");
             }
         });
     }

+ 1 - 1
chatModule/src/main/java/com/cooleshow/chatmodule/ui/CreateGroupActivity.java

@@ -53,7 +53,7 @@ public class CreateGroupActivity extends BaseMVPActivity<TcActivityCreateGroupBi
     public void onClick(View view) {
         int id = view.getId();
         if (id == R.id.tv_create) {
-            if (UiUtils.isFastClick()) {
+            if (UiUtils.isFastClick(3000)) {
                 return;
             }
             String groupName = viewBinding.etGroupName.getText().toString().trim();