From 740d1b1f0c342f525ee52a43495469e75245bba8 Mon Sep 17 00:00:00 2001 From: chenyanan Date: Fri, 29 Dec 2017 13:47:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=85=A5=E7=BE=A4=E5=B0=8F?= =?UTF-8?q?=E7=BA=A2=E7=82=B9=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/activity/VerificationGroupActivity.java | 1 + .../chat/activity/fragment/ContactsFragment.java | 13 +++++++++++++ .../jiguang/chat/application/JGApplication.java | 1 + .../jiguang/chat/controller/ChatRoomController.java | 2 +- .../main/java/jiguang/chat/view/ContactsView.java | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/chatapp/src/main/java/jiguang/chat/activity/VerificationGroupActivity.java b/chatapp/src/main/java/jiguang/chat/activity/VerificationGroupActivity.java index cbdb1b68..9b22fe74 100644 --- a/chatapp/src/main/java/jiguang/chat/activity/VerificationGroupActivity.java +++ b/chatapp/src/main/java/jiguang/chat/activity/VerificationGroupActivity.java @@ -39,6 +39,7 @@ protected void onCreate(Bundle savedInstanceState) { public void gotResult(int i, String s) { if (i == 0) { Toast.makeText(VerificationGroupActivity.this, "申请已发出,等待审核", Toast.LENGTH_SHORT).show(); + finish(); } else { HandleResponseCode.onHandle(VerificationGroupActivity.this, i, false); } diff --git a/chatapp/src/main/java/jiguang/chat/activity/fragment/ContactsFragment.java b/chatapp/src/main/java/jiguang/chat/activity/fragment/ContactsFragment.java index 205c3043..c4cfd8bd 100644 --- a/chatapp/src/main/java/jiguang/chat/activity/fragment/ContactsFragment.java +++ b/chatapp/src/main/java/jiguang/chat/activity/fragment/ContactsFragment.java @@ -259,6 +259,15 @@ public void gotResult(int i, String s, UserInfo fromUserInfo) { @Override public void gotResult(int i, String s, List list) { if (i == 0) { + if (JGApplication.forAddIntoGroup.size() > 0) { + for (String addName : JGApplication.forAddIntoGroup) { + if (addName.equals(list.get(0).getUserName())) { + return; + } else { + JGApplication.forAddIntoGroup.add(list.get(0).getUserName()); + } + } + } GroupApplyEntry entry; //邀请,from是邀请方 if (type.equals(GroupApprovalEvent.Type.invited_into_group)) { @@ -295,6 +304,10 @@ public void gotResult(int i, String s, List list) { } } entry.save(); + + int showNum = SharePreferenceManager.getCachedNewFriendNum() + 1; + mContactsView.showNewFriends(showNum); + SharePreferenceManager.setCachedNewFriendNum(showNum); } } }); diff --git a/chatapp/src/main/java/jiguang/chat/application/JGApplication.java b/chatapp/src/main/java/jiguang/chat/application/JGApplication.java index ac946e01..0052b42a 100644 --- a/chatapp/src/main/java/jiguang/chat/application/JGApplication.java +++ b/chatapp/src/main/java/jiguang/chat/application/JGApplication.java @@ -115,6 +115,7 @@ public class JGApplication extends com.activeandroid.app.Application { public static List alreadyRead = new ArrayList<>(); public static List unRead = new ArrayList<>(); public static List forAddFriend = new ArrayList<>(); + public static List forAddIntoGroup = new ArrayList<>(); public static Conversation delConversation; public static ArrayList selectedUser; diff --git a/chatapp/src/main/java/jiguang/chat/controller/ChatRoomController.java b/chatapp/src/main/java/jiguang/chat/controller/ChatRoomController.java index 7bb8743e..f2f1674e 100644 --- a/chatapp/src/main/java/jiguang/chat/controller/ChatRoomController.java +++ b/chatapp/src/main/java/jiguang/chat/controller/ChatRoomController.java @@ -34,7 +34,7 @@ public ChatRoomController(ChatRoomView chatRoomView, Context context) { } private void initChatRoomAdapter() { - Dialog loadingDialog = DialogCreator.createLoadingDialog(mContext, "正在加载聊天室..."); + Dialog loadingDialog = DialogCreator.createLoadingDialog(mContext, "正在加载..."); loadingDialog.show(); ChatRoomManager.getChatRoomListByApp(0, 10, new RequestCallback>() { @Override diff --git a/chatapp/src/main/java/jiguang/chat/view/ContactsView.java b/chatapp/src/main/java/jiguang/chat/view/ContactsView.java index a4b9d22c..fedd38ea 100644 --- a/chatapp/src/main/java/jiguang/chat/view/ContactsView.java +++ b/chatapp/src/main/java/jiguang/chat/view/ContactsView.java @@ -115,6 +115,7 @@ public void showNewFriends(int num) { public void dismissNewFriends() { SharePreferenceManager.setCachedNewFriendNum(0); + JGApplication.forAddIntoGroup.clear(); JGApplication.forAddFriend.clear(); mNewFriendNum.setVisibility(INVISIBLE); }